Description of problem: This is probably related to https://issues.jboss.org/browse/ISPN-586. When I configure a jdbc cache store without specifying connnectionFactoryClass, the ManagedConnectionFactory is used and it cannot acquire a connection to DB: [java] 13:56:05,419 ERROR [org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory] (MemcachedServerWorker-2-1) ISPN008018: Sql failure retrieving connection from datasource: java.sql.SQLException: javax.resource.ResourceException: Error checking for a transaction... ...the whole exception attached On the other hand, I was able to connect to the database with SimpleConnectionFactory but this is not usable in production environment. Version-Release number of selected component (if applicable): EDG Snapshot from 2011-11-25 (contains JBoss AS 7.1.0.Beta1 "Tesla" and Infinispan 5.1.0-SNAPSHOT) How reproducible: Store a cache entry to a cache defined with jdbc-store configuration attached, datasources subsystem configuration attached as well. As I said, I was able to store a key to the cache store when using SimpleConnectionFactory. I needed to do a few configuration changes, though: I needed to add the following properties to jdbc-store: <property name="connectionFactoryClass">org.infinispan.loaders.jdbc.connectionfactory.SimpleConnectionFactory</property> <property name="driverClass">org.h2.jdbcx.JdbcDataSource</property> <property name="connectionUrl">jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</property> <property name="userName">sa</property> datasources subsystem looked like this: <datasources> <datasource jndi-name="java:jboss/datasources/JdbcDS" enabled="true" use-java-context="true" pool-name="java:jboss/datasources/JdbcDS"> <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url> <driver>h2</driver> <pool></pool> <security> <user-name>sa</user-name> <password>sa</password> </security> </datasource> <drivers> <driver name="h2" module="com.h2database.h2"> <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class> </driver> </drivers> </datasources> Another thing that was needed was to add <module name="com.h2database.h2" export="true"/> to ${EDG_HOME}/modules/org/infinispan/cachestore/jdbc/main/module.xml
Created attachment 537984 [details] Exception thrown
Created attachment 537985 [details] Configs for reproducing the bug
Just FYI: I created AS7-3674 since I thought it was another problem but it turned out to be the same issue as ISPN-604. So this bug is dependent on AS7-3674 which should be automatically fixed once ISPN-604 is implemented and this change gets into Infinispan subsystem of AS7.
Tristan, is this going to be fixed in ER03 i.e before limited availability release?
Highly unlikely unfortunately
The technical_notes? flag indicates that this is a known issue. Please add summarized cause (what caused the issue) and consequence (how the issue manifests) information about this in the Technical Notes field.
Created attachment 572707 [details] JDG 6.0.0.ER5 + transactional datasource hack This JAR is identical to the distributed JDG 6.0.0.ER5 JAR with the addition of Mircea's hack to workaround the issue of using a transactional datasource with a cachestore
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause:When the JDBC Cache Store is configured without specifying connnectionFactoryClass, the ManagedConnectionFactory is selected by default. Consequence: ManagedConnectionFactory is unable to connect to the database. Fix: None Result: Specify connnectionFactoryClass in jdbc cache store prior to attempting a transaction. Failure to do so will result in a connection error via the ManagedConnectionFactory.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,4 +1,4 @@ Cause:When the JDBC Cache Store is configured without specifying connnectionFactoryClass, the ManagedConnectionFactory is selected by default. Consequence: ManagedConnectionFactory is unable to connect to the database. Fix: None -Result: Specify connnectionFactoryClass in jdbc cache store prior to attempting a transaction. Failure to do so will result in a connection error via the ManagedConnectionFactory.+Result: None
Tristan indicates that ER6 will contain a work around in the code.
This issue has been cloned to 807674 to track the proper fix (based on ISPN-604). For JDG 6 this workaround solves the problem
To include the workaround in the release note, please specify what need to be done as a workaround in the technical notes box in addition to comments/changes to the CCFR information.
Misha, the workaround does not require any user action: it is now built-in behaviour.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,4 +1 @@ -Cause:When the JDBC Cache Store is configured without specifying connnectionFactoryClass, the ManagedConnectionFactory is selected by default. +Previously, when the JDBC Cache Store was configured without specifying connnectionFactoryClass, the ManagedConnectionFactory was selected by default. As a result, ManagedConnectionFactory could not connect to the database. This behavior is now fixed and a connection to the database is established as expected when no connectionFactoryClass is specified for the JDBC Cache Store.-Consequence: ManagedConnectionFactory is unable to connect to the database. -Fix: None -Result: None
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -Previously, when the JDBC Cache Store was configured without specifying connnectionFactoryClass, the ManagedConnectionFactory was selected by default. As a result, ManagedConnectionFactory could not connect to the database. This behavior is now fixed and a connection to the database is established as expected when no connectionFactoryClass is specified for the JDBC Cache Store.+Previously, when the JDBC Cache Store was configured without specifying <classname>connnectionFactoryClass</classname>, the <classname>ManagedConnectionFactory</classname> was selected by default. As a result, <classname>ManagedConnectionFactory</classname> could not connect to the database. This behavior is now fixed and a connection to the database is established as expected when no <classname>connectionFactoryClass</classname> is specified for the JDBC Cache Store.
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.