-->
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.  [ 3 posts ] 
Author Message
 Post subject: Is possible create a Hibernate business logic project??
PostPosted: Thu Apr 28, 2011 1:30 pm 
Newbie

Joined: Thu Apr 28, 2011 1:13 pm
Posts: 3
Is possible create a library that contains business logic for use in a web project and a desktop project?

I'm working on two java projects that use the same database and the same business logic.
A project is a Web application and the other a desktop application.
I built a project called model containing hibernate libraries for persistence of data and contains dao classes and services for managing business logic.
This project generates a jar that I use in the two applications.
I wonder if this strategy is good or bad?
Not sure if it will bring inconvenience with concurrency.
I welcome any comments.

PS: Sorry for my English level.


Top
 Profile  
 
 Post subject: Re: Is possible create a Hibernate business logic project??
PostPosted: Tue Jun 07, 2011 9:48 am 
Newbie

Joined: Tue Jun 07, 2011 8:09 am
Posts: 2
This is not really a Hibernate question, but rather a general Java question.

I see no serious problem with a jar shared across two apps. Whether this will create concurrency issues depends mainly on your use of static members, and the classloading policy in use. Are the two apps in the same EAR?

Keep in mind that business logic doesn't *have* to be written in code -- you can use rules engines, things like Automated Business Logic, etc...

-- Joe


Top
 Profile  
 
 Post subject: Re: Is possible create a Hibernate business logic project??
PostPosted: Thu Jun 09, 2011 7:32 pm 
Newbie

Joined: Thu Apr 28, 2011 1:13 pm
Posts: 3
Thanks for your Reply!

You're right! Is not really a hibernate question.
The two Applications are in differents Ear.

I use the same jar in both projects, but had to put the credentials directly in the hibernate.cfg.xml

Now, I tried to use a jndi datasource on the web and desktop application.

I created a data pool connection and jndi name for the web app, but i donĀ“t know if its possible use the same jndi in the desktop app.

I'm using glassfish app server.

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.