The resource is already being used in a parent transaction

Hi,

I want to insert the data into DB through JDBC adapter and I am using transaction handling for which is in inside a LOOP.
the steps as follows

LOOP over document list
pub.art.transaction:startTransaction
calling jdbc adapter for insertion
pub.art.transaction:commitTransaction
catch block
pub.art.transaction:rollbackTransaction.

The problem is:
since I am using transaction handling in LOOP the following error occurs

“[SIZE=2]
ERROR 25.11.08 15:11:01 || 150953.164 : [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service rbaapagos.adapters:insertPaGOS_out_t.
[ART.117.4011] Adapter Runtime (Adapter Service): Unable to connect to resource rbdbconnections.rbaapagos:aapagos. The resource is already being used in a parent transaction

could anyone suggest a solution to overcome this issue.

Regards,
RDS
[/size]

RSD,

Is there any special reason you are using start and commit transaction in loop? I would say to use start transaction as the first step in your flow service even before Try block so you can roll back the transaction if your code goes to catch block.
BTW what adapter are you using and what type of transaction is that i.e. local or no transaction.

Is this service being called by another service? Is that service making JDBC service calls?

The error looks like a Dangling transactions issue. I agree with Talha Khan call the start transaction as the first step in your flow.