-->
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.  [ 1 post ] 
Author Message
 Post subject: When does Hibernate actually connect to the database
PostPosted: Wed Aug 09, 2006 3:48 pm 
Beginner
Beginner

Joined: Fri Feb 04, 2005 2:44 pm
Posts: 25
Location: Buffalo, NY
Sorry if this is a beginners question, but when does Hibernate actually connect to the database? Is it when SessionFactory is instanciated? Or when one calls Session's openSession method?

The reason I'm asking is because connecting to a database is typically considered an 'expensive' operation. So if I only ever want to connect once, so I need a public static SessionFactory, a public static Session, or both? (I don't want to pass them as method parameters)

TIA.


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

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.