-->
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.  [ 3 posts ] 
Author Message
 Post subject: mulitple sessionfactory for one database
PostPosted: Thu Nov 18, 2004 10:21 am 
Newbie

Joined: Thu Nov 18, 2004 10:15 am
Posts: 1
Location: Atlanta
Hibernate version:
2

What are implications (such as transactions) if there are multiple sessionfactories for one single database. I have the need to package related hibernate classes with their business services.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 12:21 pm 
Newbie

Joined: Sat Nov 13, 2004 8:09 am
Posts: 14
Location: Hamburg
When You are using a second level cache, You have to choose one with cluster capability. Transactions are handled by JDBC-driver of the the Database. So it should not be any concern as long You are using the same database. The clustered cache means a significant overhead (especialy when threads are on different machines), so I used a JMS-based cache to do the synchronization asynchronly. (This means definitly that You will have some conflicts in favor to performance)
Another concern is the heavy weight of SessionFactories. They need some time to initialize and will use lot of memory. I do not understand Your intend; why You have to package all hibernate classes and what are Your business services? (how many;) )


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 3:37 pm 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
An other approach would be to have a second level cache per SessionFactory, use <version> for optimistic locking and have an eviction policiy on the second level cache which cleans up lets say every 10 minutes or what ever is suitable for you.

HTH
Ernst


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.