-startTransaction(t1)
–sequence(success)
—sequence(failure)
insert (local trasaction, connect to db1)
update (no transaction, connect to db2)
commit(t1)
—sequence(done)
rollback(t1)
i am getting the specified exception
Error ART.117.4011 Unable to connect to resource .The resource is already being used in a parent transaction.
As per my understaing we can not use two local transactions in one explicit transaction.
if i create a seperate flow and use explicit transaction for insert service and called up into the current explict transaction, if insert is success then it will commits the transaction even though update fails.
I want to roll back insert service if update fails.
You can’t enlist two local_transactions that way in webMethods IS they have to be wrapped each in an explicit transaction. What you are trying to do is normally what is considered a distributed transaction. You can try using an XA_Transaction type and then try coordinating it across the two db’s. That gets complicated. You could also just do a compensating transaction back to the insert table.
However why not just run the update first and if it fails just don’t do the insert?
The ideia was to either insert all or roll back and insert none.
It is exaclty as stated in Adapter documentation, but it returns the error:
[ART.117.4011] Adapter Runtime (Adapter Service): Unable to connect to resource XXXXXXXXXXXXXX:YYYYYYY. The resource is already being used in a parent transaction.
Is your commit inside your loop? If so take it out. The other thing is you don’t need to generated a transaction id for that service, IS will handle that for you.
you can nest your transactions, don’t need to separate by local_transaction or none, will not make any difference. as long as your parent and inner transactions are nested correctly it will work. transactions are fun aren’t they?:eek:
I have seen your code sample. .Can you explain your problem in brief? When do you receive this error? Which adapter service are you invoking in your code…
What is your transaction type? Are you passing the same Txn name to start, commit and rollback transaction services.
Are you mapping explicitly the same transactionName value given in the start and commit/rollback and even in the catch block section for rollback with EXIT signal on failure?
Hello guys, @M@he$h
on the first step i create an transaction name based on the current timestamp.
When i start the transaction i use as transaction Name the generated one.
On the try sequence i loop through a document list and for every document i call a new flow service when i first do controls, and only if the controls return an OK sms i call the jdbc adapter (A Dynamic SQL adapter)
I’m using LOCAL TRANSACTION as transaction type.
@M@he$h, rmg
Yes i think i’m using the same transaction name on commit or rollback. The transaction name is the one generated on the first step of the flow service
Adapter Runtime: Error Logged. See Error log for details. Error: [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service AgosEccezioneCoperto.adapters.database.loadVariazioneAnagrafica:insertIntoVariazioneAnagrafica.
[ART.117.4011] Adapter Runtime (Adapter Service): Unable to connect to resource connection:DB2Connection. The resource is already being used in a parent transaction.
2013-01-08 17:40:13 CET [ISP.0090.0004E] AgosEccezioneCoperto.adapters.database.loadVariazioneAnagrafica:insertIntoVariazioneAnagrafica – [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service AgosEccezioneCoperto.adapters.database.loadVariazioneAnagrafica:insertIntoVariazioneAnagrafica.
[ART.117.4011] Adapter Runtime (Adapter Service): Unable to connect to resource connection:DB2Connection. The resource is already being used in a parent transaction.
2013-01-08 17:40:13 CET [ISP.0090.0004E] AgosEccezioneCoperto.services.loadVariazioneAnagrafica:insertLoadVariazioneAnagrafica – [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service AgosEccezioneCoperto.adapters.database.loadVariazioneAnagrafica:insertIntoVariazioneAnagrafica.
[ART.117.4011] Adapter Runtime (Adapter Service): Unable to connect to resource connection:DB2Connection. The resource is already being used in a parent transaction.
2013-01-08 17:40:13 CET [ISP.0090.0004E] AgosEccezioneCoperto.services.Caricamento:ParsificaRecordAnagrafica – [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service AgosEccezioneCoperto.adapters.database.loadVariazioneAnagrafica:insertIntoVariazioneAnagrafica.
[ART.117.4011] Adapter Runtime (Adapter Service): Unable to connect to resource connection:DB2Connection. The resource is already being used in a parent transaction.
2013-01-08 17:40:13 CET [ISP.0090.0003C] [AgosEccezioneCoperto.services.Caricamento:CaricamentoFlussoAnagrafica]- Start
2013-01-08 17:40:13 CET [ART.0114.1007E] Adapter Runtime: Error Logged. See Error log for details. Error: [ART.117.4018] Adapter Runtime (Adapter Service): Error while closing transactions at service completion Error:[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections.
[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections…
[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections.
[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections.
2013-01-08 17:40:13 CET [ISS.0015.9998E] Exception → com.wm.pkg.art.error.DetailedServiceException: [ART.117.4018] Adapter Runtime (Adapter Service): Error while closing transactions at service completion Error:[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections.
[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections…
[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections.
[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections.
2013-01-08 17:40:13 CET [SCC.0121.0116W] Active transaction detected while completing service AgosEccezioneCoperto.services.Caricamento:CaricamentoFlussiAnagrafica. Rolling back pending operations.
Caught throwable: java.lang.NullPointerException
at com.webMethods.portal.portlet.wm_xt_ldapdirsvc.service.connection.cookie.LdapPagingCookie.generateQueryHolder(LdapPagingCookie.java:150)
at com.webMethods.portal.portlet.wm_xt_ldapdirsvc.service.connection.cookie.LdapPagingCookie.prepareQuery(LdapPagingCookie.java:75)
at com.webMethods.portal.portlet.wm_xt_ldapdirsvc.service.LdapDirQueryProvider.search(LdapDirQueryProvider.java:360)
at com.webMethods.portal.portlet.wm_xt_ldapdirsvc.service.LdapDirQueryProvider.lookupByID(LdapDirQueryProvider.java:185)
at com.webMethods.portal.mech.dir.impl.DirSystemMechanics$1.visit(DirSystemMechanics.java:224)
at com.webMethods.portal.mech.dir.impl.DirSystemMechanics.visitDirServices(DirSystemMechanics.java:451)
at com.webMethods.portal.mech.dir.impl.DirSystemMechanics.lookupPrincipalByID(DirSystemMechanics.java:222)
at com.webMethods.portal.bizPolicy.command.dir.LookupPrincipalByID._lookupPrincipalByID(LookupPrincipalByID.java:119)
at com.webMethods.portal.bizPolicy.command.dir.LookupPrincipalByID.lookupPrincipalByID(LookupPrincipalByID.java:101)
at com.webMethods.portal.bizPolicy.biz.dir.impl.DirSystemBizPolicy.lookupPrincipalByID(DirSystemBizPolicy.java:112)
at com.webMethods.sc.directory.impl.DirectorySession.lookupPrincipalByName(DirectorySession.java:520)
at com.wm.app.b2b.server.cds.CDSUserManager.getUser(CDSUserManager.java:116)
at com.wm.app.b2b.server.UserManager.getUser(UserManager.java:115)
at com.wm.app.b2b.server.ACLManager.allow(ACLManager.java:400)
at com.wm.app.b2b.server.ACLManager.allow(ACLManager.java:390)
at com.wm.app.b2b.server.ACLManager.permitInvoke(ACLManager.java:1924)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:208)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:30)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:363)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:547)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:386)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:234)
at com.wm.app.b2b.server.comm.DefaultServerRequestHandler.handleMessage(DefaultServerRequestHandler.java:119)
at com.wm.app.b2b.server.HTTPMessageHandler.process(HTTPMessageHandler.java:160)
at com.wm.app.b2b.server.HTTPDispatch.handleRequest(HTTPDispatch.java:181)
at com.wm.app.b2b.server.Dispatch.run(Dispatch.java:355)
at com.wm.util.pool.PooledThread.run(PooledThread.java:131)
at java.lang.Thread.run(Thread.java:662)
Just try the below steps:
1> Disable and enable the connection on JDBC and then try to run the service
2> Reload WmART package
3> What is Minimum Pool Size=? in JDBC connection.
4> As a best practice it is always good to use the WmPublic/pub.flow:getLastError as the first step in catch block and then WmART/pub.art.transaction:rollbackTransaction
If not working see below:
Explanation: WmART attempted to create a new connection to the specified resource, but detected that
the resource is currently enrolled in an ongoing transaction.
Action: This is an internal error. Contact webMethods Customer Care. Please have the following
information available: system and setup specifics, journal logs, and error logs with the
stack trace exposed.
Please call your Insert and update adapter’s service in different transaction boundary (wrapped with two different transaction boundary) as you are trying to insert and update operation and both db are different.
You can achieve this in XA transaction but for LOCAL_Transaction please use different transaction boundary.
Try the above and let me know if you have any question.
Hello guys,
I’m using 10 as the maximum size of the pool to the JDBC adapter configuration settings.
I’m using a single database and I’m trying to loop over an array of input records (list of documents)
For all records in the input array I have to do some custom validation controls. Only if the record pass validation checks I have to insert on the DB, otherwise I have to do the rollback, returning to its previous state by canceling all changes.
I think I solved the problem with some sort of solution.
Initially loop the input array and run the validation controls.
Only if controoli validation successfully complete call a new service in which I open the transaction, do the loop dell’aaray input and insert the records in the DB. If something goes wrong in the sequence Catch