-->
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.  [ 1 post ] 
Author Message
 Post subject: Multiple SessionFactory's in OSGi environment
PostPosted: Sun Mar 22, 2009 2:25 am 
Beginner
Beginner

Joined: Mon Jun 06, 2005 12:10 pm
Posts: 20
I'm trying to figure out if it's possible to have a separate SessionFactory for each of the bundles that use Hibernate for persistence. I've seen several places that talk about having a single SessionFactory that get dynamically reconfigured when new bundles are added that have classes that should be persisted. But I haven't seen anything about having something like a SessionFactory for each bundle. Obviously a couple of things I'm worried about are:

1) How will Hibernate load classes from the other bundles that use it? I thought of making sure that the thread classloader used when the Configuration object is created and the SessionFactory created is the bundle classloader, but is that enough?

2) How much static data is used by Hibernate? I know that at least the session caches are associated with Session objects, but what about the L2 cache? Is it associated with the SessionFactory or is it global? What about other configuration data, like I noticed the Environment object seems to be nothing but static state for configuration data.

I'm sure others will follow from answers to the above and I'm sure there are others that I'm not thinking of, but that's all I can think of at midnight on a Saturday. :)

Thanks,
Rich


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.