How to handlle multiple ear and common database.

Discussions

EJB design: How to handlle multiple ear and common database.

  1. Hi Friends, Need urgent help. I working on a project where there will be multiple ear ,each for one application. There are 4 project and 4 ears and one common util war file which will be shared by all ears. Problem is : 3 of the projects will use same database tables. I am using hibernate ORM mapping for database table. Q1. In the above scenario db access table are 90% common in 3 projects. Should I go for instead of 3 ears club into 1 EAR and current 3 project as a 3 module in 1 club ear or per project one ear? Pls suggest me the approach and advantage and disadvantages of the approach. Q2 : Should I put the data-beans and table mapping files (e.g account.hbn.xml) & hibenate.cfg.xml file in common war(centralized or shared) or replicate the copies of all beans mapping xml and beans classes in every ear. If you suggesting to use the centralized/shared data configuration approach then how EAR 's jvms will handle Transaction for every ear. I am using Websphere app server6.1, hibernate3 and db2 8.0 Waiting for your interesting replies. Thanking you in advance. Navin.
  2. Use one jar for ALL hibernate related objects. Add references to all the ears. Now, you are not bothered with connection mechanisms. You have to configure connections for only on project. use WAS transaction factories for the transactional support. It was pretty irresponsible of you to post a 'feed-me' kind of question.