[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - UNmanaged JBoss Connection Pool wanted!

jpowellAtTf do-not-reply at jboss.com
Wed Aug 5 23:37:30 EDT 2009


Hi,

I am struggling to put an "unmanaged" (in CMP terms) alongside a managed datasource in our JBoss 4.2.2GA, (Hibernate) SEAM 2.1 application. I want to do plain vanilla JDBC without interference from the JBoss connection manager and will take responsbility for managing/closing logical connections retrieved from the JNDI pool. The tables handled by each datasource will be isolated and should not interfere with each other, even though they are on the same database.

The DS configuration is as follows:

    
  |    <local-tx-datasource>
  |       <jndi-name>ds1</jndi-name>
  |       <connection-url>jdbc:oracle:thin:@X.Y.Z.T:port:sid</connection-url> 
  |       <driver-class>oracle.jdbc.OracleDriver</driver-class>
  |       <user-name>user</user-name>
  |       <password>pass</password>
  |    </local-tx-datasource>
  |    
  |    <no-tx-datasource>
  |       <jndi-name>jdbc/ds2</jndi-name>
  |       <use-java-context>false</use-java-context>
  |       <connection-url>jdbc:oracle:thin:@X.Y.Z.T:port:sid</connection-url> 
  |       <driver-class>oracle.jdbc.OracleDriver</driver-class>
  |       <user-name>user</user-name>
  |       <password>pass</password>
  |    </no-tx-datasource>
  | 

I am perfectly content to let 'java:/ds1' be managed by SEAM & JBoss, but want to have complete control over 'jdbc/ds2'. In the console I can see ds2 being registered, I can start a JNDI context using 'jdbc/ds2', but get the following errors when trying to set autocommit or do a commit on a connection:


  | For JBoss-managed connection pool, autoCommit not supported.
  | 
  | OR
  | 
  | Trouble committing transaction: java.sql.SQLException: You cannot commit during a managed transaction!
  | 

Note that I have carefully wrapped the connection retrieved from the datasource so as to have access to the physical Oracle connection but only close the logical connection.

 :banghead: expresses it really well! 

Any help is much appreciated.

Best regards,

Jon

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4248287#4248287

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4248287



More information about the jboss-user mailing list