-->
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.  [ 2 posts ] 
Author Message
 Post subject: Multiple SessionFactories mapping the same tables in one app
PostPosted: Thu Mar 30, 2006 10:35 pm 
Newbie

Joined: Tue Jul 20, 2004 8:52 pm
Posts: 6
I've recently joined a fairly big new project which has an unusual architecture of having a seperate SessionFactory for each module of the project. All the modules are deployed together in a single WAR file. There is also a common module with a number of hibernate mappings, that is included in each other modules hibernate mappings.

I can understand multiple session factories when there is different datasources, but all the tables are in the single database. So what we have is multiple session factories that have mappings to the same User, Audit, Message etc tables. There is a facade for each module, where the transactional boundries are, that only talk to one particular SessionFactory each.

It seems wrong to have multiple session factories mapping to the same tables in one application, but I need some solid reasons before I could convince them to change it. Any ideas what could go wrong? concurrency issues etc?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 12:46 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I can't think of anything that would go wrong, beyond the expected write locks and stale objects. But you'd have those even if there was only one factory per JVM, if it was used by multiple threads to create sessions. And that's how factories are usually used.


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