Camunda engine embedding

Hello!
I am pretty new at Camunda.
At the moment I’m trying to integrate Caminda Engine in my web-application. So, i have my spring.xml, and going by Getting started guide. I have some questions and hope you can help me.
First: if i’m integrating camunda in my app, they share context, right?
Second: my app already have database connection, but i can see in example what engine uses explicitly defined bean “datasource”. So, if i define this datasource with existing paramerets, my app and engine will use the same connection pool? I’m getting optimistic lock exceptions. Can i fix it, or can i somehow use for engine an existing datasource (my app is based on cuba platform)?
Thanks!

Hi @Anastasia,

Which kind of context do you mean? If class loading context: that is correct.

If they use the same bean, yes.

Optimistic locking exceptions are to be expected in certain situations. See https://docs.camunda.org/manual/7.9/user-guide/process-engine/transactions-in-processes/#optimistic-locking for details. https://docs.camunda.org/manual/7.9/user-guide/process-engine/transactions-in-processes/#transaction-boundaries should give you an idea how to limit the impact of transaction rollbacks.

Cheers,
Thorben