-->
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: How to check whether active session under the SessionFactory
PostPosted: Wed Jun 22, 2011 6:31 am 
Newbie

Joined: Sun Jun 12, 2011 5:44 am
Posts: 4
Hi,

I am exploring on dynamically modify some tables' structure on runtime. Some expert solutions that I found are to build multiple SessionFactory, and always use the latest factory for latest hibernate mapping.

The concept in my mind is to have a independant SessionFactory for each dynamic table, and whenever there is update to a table structure, the app will shutdown the corresponding SessionFactory and re-create a new one with latest mapping.

My question here is how to ensure no other users are holding active session when I close the factory, to avoid any exception (e.g. somebody try to insert a record with old mapping). Does hibernate provide any method for such kind of checking or I have to build my own mechanism? As I am new to hibernate, my approach may not be the best and I am open to any other good suggestion :)

Thanks.


Top
 Profile  
 
 Post subject: Re: How to check whether active session under the SessionFactory
PostPosted: Wed Jun 22, 2011 9:51 pm 
Newbie

Joined: Sun Jun 12, 2011 5:44 am
Posts: 4
Appreciate any guidance from experts, or please advise if my question is not clear.


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.