-
1. Re: Datasources and Vanatec JDO
weston.price Dec 11, 2006 2:33 PM (in response to germanoc)More like as not your *-ds.xml file is not setup correctly. Can you please post it here?
-
2. Re: Datasources and Vanatec JDO
germanoc Dec 11, 2006 4:18 PM (in response to germanoc)
<local-tx-datasource>
<jndi-name>jdbc/OracleSirDSLocal</jndi-name>
<connection-url>jdbc:oracle:thin:@mymachine:1521:asdb</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>myuser</user-name>
mypass
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>Oracle9i</type-mapping>
</local-tx-datasource> -
3. Re: Datasources and Vanatec JDO
germanoc Dec 11, 2006 4:21 PM (in response to germanoc)/*************/
<local-tx-datasource>
<jndi-name>jdbc/OracleSirDSLocal</jndi-name>
<connection-url>jdbc:oracle:thin:@aaa:1521:asdb</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>a</user-name>
a
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>Oracle9i</type-mapping>
</local-tx-datasource>
/*************/
I've tested the datasource with another simple jdbc applictaion and works fine. -
4. Re: Datasources and Vanatec JDO
weston.price Dec 11, 2006 4:43 PM (in response to germanoc)The issue is the JCA specification which states that all statements outside of a transaction must occur with autocommit set to true. I would guess that you are attempting to execute this code outside of a Local or XA transaction and that as a result the underlying connection is set to autocommit == true which is causing the issue when Vanacted attempts to commit against the underlying resource. In other words, the transaction demarcation is not being appropriately started/terminated.
In what context are you executing your code? -
5. Re: Datasources and Vanatec JDO
germanoc Dec 11, 2006 5:21 PM (in response to germanoc)The exception ocurrs when trying to initialize the JDO Persistent Manager, don't know what exactly jdo does. It uses two datasources, one for normal operations, and one to manage id's and other stuff.
/*************
I would guess that you are attempting to execute this code outside of a Local or XA transaction and that as a result the underlying connection is set to autocommit == true
*****************/
Yoú're right. Vanatec told me that they contol the transaction, so they need the conection to be autocommit=false.
Is any property o configuration to make explicit in the datasource to set autocommit in false?
thanx -
6. Re: Datasources and Vanatec JDO
weston.price Dec 11, 2006 5:45 PM (in response to germanoc)No as this would be in violation of the JCA specification. The only way that this would happen is if you began a JTA transaction prior to the initialization of the Vantac persistence manager. This would put the connection in the correct state for Vantec to use. However, the idea of Vantec *controlling* the transaction would worry me as this is usually not the role of an ORM running within the context of an application server. ORM's typically provide transaction demarcation in 2 tier environments but delegate this functionality to the underlying application server/user transaction scenarios in an enterprise environment and simply become a participant.
Also, it looks as if you asked the same question here:
http://www.vanatec.com/en/community-support/forum/discussions/view_topic?topic_id=4401&topic_offset=0
and Vanatec seems to suggest that they will work with JCA however if they are indeed modifying the transaction state of the underlying connection (doing commit/rollback) this would not be the case as this is the role of JCA, not Vantec.
Again, I could be in error on this being that I do not know Vantec or their API, but something sounds sketchy. -