Monday, February 11, 2008

Spring

Post your Spring Framework questions here.

7 comments:

Amila said...

Nice piece of work.....

Nishantha said...

Hi All,

Please join me to congratulate Amila Shrimal on his new Job at Apturion as a Java Software Engineer

Regards
Sampath

nuwan said...

Hi All,

First of all I thanks to Mr.Sampath for initiative for this blog.

I have a question about Hibernate/Spring DAO integration. In our application, we use more than 200 domain and DAO (HibernateDaoSupport ) classes with single hibernate session factory (multiple spring configuration files). I want to make sure is it ok use single session factory? Or should I use multiple session factories?

Regards
Nuwan

Nishantha said...

Creating a session factory is a very heavy operation. So normally we keep one session factory and create multiple sessions. Also it is not required to have one separate Dao for each domain object.

Nuwan said...

Thanks for the reply,As I understood, define hibernate session factory as singleton bean, and inject it to DAO it will create only one session factory and multiple session for each DAO, my question is having big number of domain classes mapped to single session factory will effect the performance of application ?

regards

Nuwan

Nishantha said...

Higher the no of domain objects, it will affect the performance. But if you really need that much of domain objects you have to do it. But you can use some of the performance optimization methods like lazy loading,caching etc.

Nuwan said...

Ok Thanks Sampath.