• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Non transactional with hibernate

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i have a question, is there a way to use hibernate with a non transactional database?

Thanks
 
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This I am not sure of but you could go here to see a list of databases that are currently supported:

http://hibernate.org/80.html

Which db did you have in mind?
 
Jaime M. Tovar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, im using informix, it is supported and in the transactional databases it works fine, but could not make it work in non transactional, has anyone tried it and made it work?
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Hibernate with Informix and I haven't had any issues with transactions.

What do you mean by non-transactional? Are you trying to avoid explicitly beginning/committing a transaction?

Hibernate does support auto-commit.
 
Jaime M. Tovar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope, i have two databases in informix that were created using the nontransactional option, (they dont use transactions even if you want) so everything is autocommit and you cant roll back. But it seems that hibernate has problems dealing with this kind of schema.
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how to keep Hibernate from calling commit() other than to create your own transaction and transaction factory classes. That would allow you to intercept the transaction calls and skip them.

See the source to org.hibernate.transaction.JDBCTransactionFactory and JDBCTransaction as examples.

An entry in the Hibernate configuration file would tell Hibernate to use your factory:

hibernate.transaction.factory_class = org.hibernate.transaction.NonTransactionalTransactionFactory
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic