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.  [ 5 posts ] 
Author Message
 Post subject: Design pattern "Thread Local Session" in J2EE
PostPosted: Thu Mar 18, 2004 2:13 pm 
Newbie

Joined: Thu Mar 18, 2004 1:48 pm
Posts: 6
Hi,

I'm trying use Thread Local Session in J2EE.
I have a Session Facade with my business methods.
For each business methods I need the session, so I will create the HibernateSession object in every methods to obtain the session, right ?.

My question:

The HibernateSession class need to be a session bean ?.
If no how can I use it from my Sesion Facade ?.

I'm Using JBOSS and MBEAN as describe in the article "Using Hibernate with JBoss"

Thanks

Marco Polo


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 19, 2004 5:52 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
HibernateSession must not be an EJB.
Every EJB is working on it's own thread, so to share the same session in the same thread, you must not call another EJB.
Use SLSB to entrer your business part and call the HibernateSession object implementing the TLS.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 19, 2004 8:28 am 
Newbie

Joined: Thu Mar 18, 2004 1:48 pm
Posts: 6
To call the HibernateSession from my SLSB where I must put it ?.

In the package hibernate.sar with my mapping files or in the package with my SLSB ?.

I'm not sure how to call a method in a simple java class (HibernateSession) from my SLSB

Marco Polo


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2004 9:26 am 
Newbie

Joined: Thu Mar 18, 2004 1:48 pm
Posts: 6
please help !.

nobody answer my last reply

Somebody can help me !, please.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2004 12:28 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
marcop wrote:
To call the HibernateSession from my SLSB where I must put it ?.

In the package hibernate.sar with my mapping files or in the package with my SLSB ?.


I would suggest you put it in a jar containg EJB utility classes and include that jar in the ejb jar.

marcop wrote:
I'm not sure how to call a method in a simple java class (HibernateSession) from my SLSB


If you are looking at http://www.hibernate.org/42.html, is will be:

Session aSession = HibernateSession.currentSession();


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