Using external database datasource in EJB

Hello,

We’re trying to use a camunda 7.5.6-ee and in our EJB’s we’d like to be able to perform SQL queries against an SQL Server datasource.

I can configure the datasources easily in wildfly but the SQL server can’t be XA datasource and each time I tried I got exceptions about transaction.

Is it possible to have a separate datasource that would not enrol in camunda’s transaction ?

Could you help me to setup a wildfly with camunda on a DB using an EJB connected to a different database type ?

Hello Eric,

Your service tasks use EJB Stateless Session Beans, right?
And with SQL Server you mean Microsoft SQL Server, right?
You might mark either the class or the methods accessing the MS SQL Server database with annotation
@TransactionAttribute( TransactionAttributeType.REQUIRES_NEW )
Then this part will be run in a new Transaction and is not part of the currently running transaction of the service task.

Regards, Frank

Yes it’s stateless beans.
Yes it’s m$ SQL server.

It worked I tried it before you answer and I also switched from datasource to xa-datasource for the Oracle/PostgreSQL camunda datasource.

I don’t know if it’s needed but with both it works fine.

Thanks