Hibernate : What is session factory

SessionFactory :The SessionFactory is created from a Configuration object, and as its name implies it is a factory for Session objects.The SessionFactory is an expensive object to create. It, like the Configuration object, is usually created during application start up. However, unlike the Configuration object, It should be created once and kept for later use.

The SessionFactory object is used by all the threads of an application. It is a thread safe object. One SessionFactory object is created per database. Multiple SessionFactory objects (each requiring a separate onfiguration) are created when connecting to multiple databases. The SessionFactory can also provide caching of persistent objects.

via Hibernate Architecture : Chapter 2 | DAV JavaServices Ltd. | Dinesh on Java.

One thought on “Hibernate : What is session factory

  1. Pingback: Why Is Suicide the #3 Killer of kids 15 -24 Years of Age? – Vol.107, June 30, 2011 » Dawning Visions Hypnosis, Inc.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s