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.
|
|