-->
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: Hibernate + Quartz: Handling different schemas
PostPosted: Tue Sep 08, 2009 3:53 pm 
Newbie

Joined: Tue Sep 08, 2009 3:49 pm
Posts: 1
Hi,

This is my first post here. I'm currently working on a project to create a scheduler using Quartz to schedule a number of jobs. We are using Hibernate for the back-end. However, most of the jobs don't share the same schema and they requires access to different schemas. I'm new to Hibernate and just wondering if there is a way I can configure Hibernate to make each job get a connection to the appropriate schema?

Thanks


Top
 Profile  
 
 Post subject: Re: Hibernate + Quartz: Handling different schemas
PostPosted: Tue Sep 08, 2009 5:07 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Essentially, you'll want to create a new SessionFactory for each schema you have, and programatically peg incoming requests to the right SessionFactory. I'm guessing transactions won't go across multiple databases, right? Like when someone gets a schema, they're stuck with that one for the life of the transaction?

For more complicated scenarios, there is a project called Hibernate Shards that mitigates access to multiple databases through what appears as one session manager.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.