cancel
Showing results for 
Search instead for 
Did you mean: 

data-source.xml - BaseResourceException - two phase commit

Former Member
0 Kudos

Hi,

I am seeing the following exception. Please let me know how to fix this.

thanks

Sunita

com.sap.engine.services.connector.exceptions.BaseResourceException: The resource "xxx" does not support two-phase commit and cannot be enlisted in the current transaction, because another non supporting two-phase commit resource is already enlisted for component "webContainer/applications/JavaEE/YY-TPRO/YYr-TPRO" in application "JavaEE/YY-TPRO". Only one of the enlisted resources is allowed to be non two-phase commit compliant.

I am using JDBC 1.x datasource, and the .xml looks like this:

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE data-sources SYSTEM 'data-sources.dtd'>

<data-sources>

<application-name>JavaEE/yy-TPRO</application-name>

<data-source>

<data-source-name>xxx</data-source-name>

<alias>jdbc/xxyyDB/TPRO</alias>

<driver-name>OracleThin</driver-name>

<init-connections>1</init-connections>

<max-connections>20</max-connections>

<max-time-to-wait-connection>60</max-time-to-wait-connection>

<sql-engine>vendor_sql</sql-engine>

<jdbc-1.x>

<driver-class-name>oracle.jdbc.driver.OracleDriver</driver-class-name>

<url>jdbc:oracle:thin:@sol-mercury:1521:hermes</url>

<user-name>abcd</user-name>

<password>abcd</password>

</jdbc-1.x>

</data-source>

</data-sources>

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Tried making datasource Shareable, but still see the same error

Former Member
0 Kudos

From my code there is a call to

dataSource.getConnection() which returns the connection.

But, when there is a user transaction, after utx.begin, there is a call to

dataSource.getConnection()

thats when I see the exception mentioned in the first thread. Seems like the datasource is configured properly.

I went through all the other threads specified in this one.

Any guidance will be helpful.

thanks

Surekha

GabrielSagaya
Active Contributor
0 Kudos
Former Member
0 Kudos

HI,

Thanks for the response, I already went through these threads.

My exception seems to be related to this - Problem with connection sharing if J2EE transaction is running

and suggested solutions seems to be:

The problem is caused when there is an inappropriate attempt to open a second connection in an active JTA transaction. There is either an attempt to get a second connection from an un-shareable non-XA DataSource or an attempt to get it from another non-XA DataSource. You have to:

&#9679; Use no more than one connection from this data source while the JTA transaction is active or

&#9679; Declare the data source as shareable, depending on your application logic.

Question is, How can I make data source as shareable??

This application worked fine in JBoss, weblogic and now we are trying to port it to NetWeaver.

Is any of the above options are configurable in data-sources.xml?

Thanks for your guidance and response.

Surekha

Vlado
Advisor
Advisor
0 Kudos

Check [this|http://help.sap.com/saphelp_nwce10/helpdata/en/e8/47591ac2e843d09a374e88b044bda9/frameset.htm] out.

HTH!

\-- Vladimir

GabrielSagaya
Active Contributor
0 Kudos

please go through it