my dog learned polymorphism
The moose likes EJB and other Java EE Technologies and the fly likes How to configure connection autocommit=false? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "How to configure connection autocommit=false?" Watch "How to configure connection autocommit=false?" New topic
Author

How to configure connection autocommit=false?

Max Bogdanov
Greenhorn

Joined: Mar 12, 2011
Posts: 11

Hello,
I am using Resin AS (4.18), MSSQL Server(2005) and Hibernate as JPA provider. How to configure connection autocommit=false? By default it's true.
Datasource configuration from resin.xml:


Test code from a servlet:


Output:
[12-09-10 13:04:01.516] [WARNING] [com.jp.web.TestServlet] [#22] > autocommit=true

As a result I cannot use transactions in my application, then I try to rollback the transaction I receive exception:
...
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot invoke a rollback operation when the AutoCommit mode is set to "true".
...

I can't use conn.setAutoCommit(false); method directly as I use hibernate as JPA provider.

Thanks.

OC-JA,OCP-JP,OCP-JWCD,OCE-EJBD,OCE-JPAD
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to configure connection autocommit=false?
 
Similar Threads
JNDI Mapping for oracle datasource
Importance of jbossjta-properties.xml
Getting JNDI to work on Resin 2.1.14
Resin DB-pooling + authentication. HELP!
JBOSS startup error