Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Obj-Delete produce ERROR

SA-5405

Summary


The system designers and developers had built a small number of activities to add/update/delete instance data on a class associated with a secondary database (Data-Admin-DB-Name).
However, while they were able to run the Add activity without any observable problem, when they attempted to run the delete activity this was failing with the error below.


Error Messages


2014-11-24 14:48:29,896 [    WebContainer : 9] [  STANDARD] [    MyApp:01.01.01] (myActivity.MyRuleset.Action) ERROR myserver [email protected] - Error in Obj-Delete
com.pega.pegarules.pub.database.ConnectionException: Database-General    Problem deleting an instance from the database    0        enlist: caught Exception
From: (H63D1CA9C80E0608C5B7C22B5AF9B38BF:abc123) 
    SQL: delete from EXTERNAL_DATA_TABLE where pzInsKey = ?

Caused by SQL Problems.
Problem #1, SQLState null, Error code 0: java.sql.SQLException: enlist: caught Exception
    at com.pega.pegarules.data.internal.access.ExceptionInformation.createExceptionDueToDBFailure(ExceptionInformation.java:163)
    at com.pega.pegarules.data.internal.access.Deleter.deleteInstance(Deleter.java:219)
    at com.pega.pegarules.data.internal.access.DatabaseImpl.performOps(DatabaseImpl.java:2907)
    at com.pega.pegarules.data.internal.access.DatabaseImpl.attemptToProcessUpdates(DatabaseImpl.java:2369)
    at com.pega.pegarules.data.internal.access.DatabaseImpl.processUpdates(DatabaseImpl.java:2222)
    at com.pega.pegarules.data.internal.access.DatabaseImpl.delete(DatabaseImpl.java:5608)
    at com.pegarules.generated.activity.sh_action_test_deleteobj_9c44b4e503d73c9f8ba075f87e95a9e7.step2_2_circum0(sh_action_test_deleteobj_9c44b4e503d73c9f8ba075f87e95a9e7.java:484)
    at com.pegarules.generated.activity.sh_action_test_deleteobj_9c44b4e503d73c9f8ba075f87e95a9e7.step2_0_circum0(sh_action_test_deleteobj_9c44b4e503d73c9f8ba075f87e95a9e7.java:381)
    at com.pegarules.generated.activity.sh_action_test_deleteobj_9c44b4e503d73c9f8ba075f87e95a9e7.perform(sh_action_test_deleteobj_9c44b4e503d73c9f8ba075f87e95a9e7.java:102)
    at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3040)
...
...
...
Caused by: 
com.ibm.ws.Transaction.IllegalResourceIn2PCTransactionException: Illegal attempt to enlist multiple 1PC XAResources
    at com.ibm.ws.tx.jta.RegisteredResources.enlistResource(RegisteredResources.java:870)
    at com.ibm.ws.tx.jta.TransactionImpl.enlistResource(TransactionImpl.java:1804)
    at com.ibm.tx.jta.impl.EmbeddableTranManagerSet.enlistOnePhase(EmbeddableTranManagerSet.java:195)
    at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:597)
    ... 74 more


Root Cause


The underlying application server was using container management in order to commit the SQL operations.
For the Add activity, as this was only updated information in the secondary database schema this was able to handle the transaction appropriately.
However, when performing the Delete activity, this was building performing SQL operations across both schemas. In the secondary schema this was going to delete the matching row from the class table, and in the Pega RULES schema this will add a row to pr_sys_locks to ensure other users are not trying to modify that information while it is being deleted.

In this instance as the underlying data sources weren't using an XA driver the application server was reporting the failure when attempting to manage the container update across two different data sources.


Resolution


There are potentially two different approaches that can be used to avoid the error when running the activity which will update data on both schemas.

1. Change the database driver to use XA.
This will allow for the container to perform a single managed transaction across more than one data source.

2. Disable the secondary database from being container manager.
While still using a non-XA driver you may wish to choose to disable the secondary data source from being enlisted into the container managed transaction.

 
Suggest Edit

Published January 31, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us