-->
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: How to configure Hibernate if you don't have a web tier
PostPosted: Mon Mar 15, 2004 5:54 pm 
Newbie

Joined: Sat Sep 13, 2003 12:45 am
Posts: 12
Location: Rochester, NY
I am embarking on my first application to use SLSBs (and the first to use Hibernate). The application has a remote client only, so there will be no web tier. What I am confused about is what is the correct way to initialize Hibernate (or anything else for that matter). Normally I would throw all the stuff that needed to be initialized into a start-up servlet, but since there is no web tier it seems like I shouldn't do it that way. The examples that I found either implied that you should call Hibernate.configure() in every bean, which seems wasteful, or just tells you to pull the SessionFactory out of JNDI without out explaing how to get it in there in the first place.

_________________
Jim


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2004 5:57 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Set a name for the SessionFactory in your hibernate.cfg.xml, call configure() once, it is then availabe with that name in JNDI. Most applications have some kind of startup class, there is no rule here.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.