-->
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: Best practise for composing multiple modules with Hibernate
PostPosted: Sat Feb 07, 2009 9:56 am 
Newbie

Joined: Fri Feb 06, 2009 5:09 pm
Posts: 1
Location: UK
Hi all,
We're using Hiberate 3.1.3 + Spring 2.0.2 + Maven to implement a web application. The application has been partitioned into 10+ Maven modules, some of which have persistence e.g. Employee Mng and Order Mng. These modules are combined as maven dependencies within the parent web app. A couple of the modules are used standalone in other apps.

Currently each module with O/R requirements contain distinct:
* hibernate mapping files
* hibernate session factories
* DAO + DTO definitions

As a result we:
a) have multiple hibernate sessions at runtime for each distinct persistable module. We cannot therefore use hibernate to easily cross the module boundaries with mappings, and
b) if we need to use a object in another module it has to be eagerly loaded - a big perfomance issue

We tried to define a Session factory in the parent web app module but couldn't seem to get Hibernate to detect the mapping files available in each JAR dependency.

I'd welcome any guidance on the best practice in terms of combining multiple modules that each contain groups of persistable objects?

Specific questions include:
* can each JAR file include its own mapping files?
* should there only be 1 master session factory definition
* any good reference applications illustrating this?


All help appreciated.
Shaun


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.