-->
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.  [ 2 posts ] 
Author Message
 Post subject: ThreadLocal & sessions in swing applications
PostPosted: Tue Oct 25, 2005 1:25 pm 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
I'm want to use the hibernate in action examples in a swing application. In the book's example, the thread local patten has been used in a web application. So, the servlets requests was in a unique thread.
Can I use the session in ThreadLocal in a swing application? I don't konw if all objetcts will be in the same thread.

Is there some best pratice to controll the sessions in a swing application?


Top
 Profile  
 
 Post subject: session-per-business transaction
PostPosted: Tue Oct 25, 2005 5:57 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I suggest trying session-per-business transaction pattern and wrapping your business logic objects into Hibernate and transaction wrappers with using
HiveMind based Interceptor from HiveTranse ( http://hivetranse.sourceforge.net/ )
Spring based proxy (not HibernateTemplate) http://www.onjava.com/pub/a/onjava/2005 ... tions.html

Or roll your own CGLib based weaver: http://kgionline.com/articles/aop_1/aop1.jsp

Oh, and do not use lazy=true, make life simpler

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.