• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to configure connection autocommit=false?

 
Greenhorn
Posts: 11
Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic