-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Examples for Tx & Session Handling with Spring & Hib
PostPosted: Wed Mar 17, 2004 1:25 am 
Beginner
Beginner

Joined: Tue Feb 17, 2004 7:53 am
Posts: 24
Will be of great help if anybody can provide some info on any sample examples to test Transaction and Session Management with Spring. I have evaluated Hibernate for my product and I found its really good:- ) Thanks Hibernate Team too for their support all the time. You are doing an excellent job.

I want to see if Spring can help me in Tx and Session Mgmt with Hibernate in my current system. Also, I can do the Tx handling with EJBs (CMT beans ) also, then why would I go in for Spring. Honestly, I have not gone much through the Spring documentation, but ya I read Transaction Mgmt Chapter of the SPring ref guide. and it briefly explains . Can anybody help me in this. I am not convinced yet how Spring can help me.


Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 9:32 am 
Regular
Regular

Joined: Tue Aug 26, 2003 3:09 pm
Posts: 58
http://www.hibernate.org/110.html is a good starting point. Take a look at the examples in the spring distribution as well. There are also quite a few posts in the forum on this topic - do a search and you should find more information.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 9:48 am 
Senior
Senior

Joined: Wed Aug 27, 2003 6:04 am
Posts: 161
Location: Linz, Austria
The main value proposition of Spring's Hibernate support is that is provides both transaction management *and* Session lifecycle management, while EJB CMT just provides the former. With EJB CMT, you need to care for the Session lifecycle yourself, typically with some custom ThreadLocal. Spring provides convenient, pre-built solutions here.

Furthermore, Spring provides sophisticated means to set up and wire your resources and application objects, in particular your SessionFactory, your DAOs, and your business facades. Handling a SessionFactory can cause some headaches with EJB, because you need to guarantee singleton semantics for it, rather than one SessionFactory per pooled EJB instance.

Essentially, Spring's transaction management is a lightweight *alternative* to EJB CMT, allowing you to code your DAOs and your business facades as POJOs rather than work with local SLSBs. Spring's services are available in any environment, be it in plain Tomcat or a standalone application - no EJB container required.

http://www.hibernate.org/110.html gives an introduction. Have a look at the Petclinic sample app that comes with the Spring distribution for a working example: It's "clinic" business object uses Spring's declarative transaction management with Hibernate as data access strategy. Note that Petclinic works nicely in plain Tomcat!

Juergen


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.