• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Hibernate in a non-managed environment

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to Hibernate (using Hibernate3). I took a first shot at developing an application in J2SE using Hibernate and had some mixed results. Figuring that it was more due to my lack of understanding of Hibernate, I threw it out and started over using the examples from the Hibernate CaveatEmptor as a starting point. I now have all but that last part finalized.

In particular, I've tried wrapping my DAO method calls (for example, findAll(), makePersistent(), makeTransient(), etc.) in a transaction, but I'm not sure the best way to start and commit the transaction. In my controller code, I don't think I want to have as an example:



I'm looking for suggestions on frameworks for use in a non-managed (no application server) environment for handling transactions. For example, I've tried to use the Command design pattern (GoF) but havent' quite found a way to get that to work.

And as an aside, when I tried to run my application without the beginTransaction calls, I get the following exception:



How can I configure Hibernate not to require transactions?

Thanks.
[ October 18, 2005: Message edited by: David Irwin ]
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm looking for suggestions on frameworks for use in a non-managed (no application server) environment for handling transactions.



Take a look at the Spring Framework. I haven't had a chance to use it yet, but it looks very promising. It does transaction management.

How can I configure Hibernate not to require transactions?



You can use this Hibernate configuration setting to cause Hibernate to commit after every statement:

 
Always look on the bright side of life. At least this ad is really tiny:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic