-->
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.  [ 11 posts ] 
Author Message
 Post subject: Can app developed with EntityManager deploy to Tomcat alone?
PostPosted: Tue Jun 27, 2006 12:33 am 
Regular
Regular

Joined: Wed Apr 12, 2006 12:49 am
Posts: 105
Location: Malaysia
Hi,

I would like to find out first, if I build application using Hibernate EntityManager, can my application be deployed to Tomcat alone? or I need to deploy it to other application server like jboss AS, sun application server.

Please advise.
Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 4:52 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
You can deploy it in Tomcat - but you need an embaddable ejb3 container.
Check out JBoss's embeddable ejb3 - their ejb3 project.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 09, 2006 8:44 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you actually can use Hibernate EntityManager in Tomcat alone but that would be a prehistoric choice.
Tomcat has been chosen by user for its simplicity. it is now a *weak* platform that does not provide additional simplicity than a good JavaEE app server. It actually bring more complexity since you need to take care of the Persistence context lifecycle, persistence unit startup etc etc.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 09, 2006 9:17 pm 
Regular
Regular

Joined: Wed Apr 12, 2006 12:49 am
Posts: 105
Location: Malaysia
What if I just want to use JPA which is implemented through Hibernate EntityManager but I don't want to implement EJB?

In this case, can I use Tomcat alone? do I still need to use an embaddable ejb3 container like what alesj has suggested in earlier posting.

Please advise.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 3:35 am 
Newbie

Joined: Wed Jun 21, 2006 5:46 am
Posts: 10
Location: Finland
JPA (Java Persistence API) is one part of three part EJB3 specification. JPA and EJB3 Entity Beans are defined in JSR 220: Enterprise JavaBeans,Version 3.0: Java Persistence API spec and EJB3 Session and Message-Driven Beans in JSR 220: Enterprise JavaBeans,Version 3.0: EJB 3.0 Simplified API spec.

http://jcp.org/aboutJava/communityproce ... index.html

I think you mean you don't want to use EJB3 Session beans and traditional J2EE services like JCA, JTA, JMS etc. If you only want to use JPA (defined in JPA spec), you can run it without EJB3 embeddable container or J2EE-server in Java SE environment (Tomcat).


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 3:59 am 
Regular
Regular

Joined: Wed Apr 12, 2006 12:49 am
Posts: 105
Location: Malaysia
Yes, that's exactly what I mean. Basically, that is what Netbeans 5.5 entity bean creation wizard providing us with right? whereby the wizard does not create any session or message driven bean, but use JPA & EJB3 entity beans?

Since netbeans5.5 now supports JPA with entity beans creation wizard that uses JAVA annotation as well, I'm thinking of not to use hbm.xml files so that my coding can be based on standard. As which implementation of JPA to use, I think I'll go for Hibernate instead of Toplink essential.

Another question is it is compulsory to use jdk1.5 if we want to use JPA right?

Is JPA mature enough to be use now? since EJB3 is quite new.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 4:54 am 
Newbie

Joined: Wed Jun 21, 2006 5:46 am
Posts: 10
Location: Finland
jbchurn wrote:
Another question is it is compulsory to use jdk1.5 if we want to use JPA right?

Is JPA mature enough to be use now? since EJB3 is quite new.

Thanks.


Annotation and generics are defined in jdk1.5 so JPA does not work on earlier jdks.

As for maturity I'd say its all about the tools you use for development. When the tools are good and easy to use then the technique is mature enough. I think the specification itself is a step forward and is mature enough.

I remember when we developed J2EE applications back in 2002. We decided to use EJB2 Session beans with DAO-pattern implemented by JDO 1.0. JBoss 3.0 was the server we used. These both specs were new and there were no good tools for them yet. The horror of those hand written(JBuilder 6 generator sucked) XML deployment descriptors and JDO OR-mappings. Most of the time went in configuration. Those applications are still in use though. Now the Java development tools are much better (Eclipse, Netbeans, Maven, Ant, XDoclet etc.) and OR-tools (Hibernate, Bea Kodo, Toplink etc.) are mature enough and well documented for easier OR-mapping.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 5:37 am 
Regular
Regular

Joined: Wed Apr 12, 2006 12:49 am
Posts: 105
Location: Malaysia
Thanks for sharing your experience with me.

If I use JPA, should I refer to the original EJB JPA specification or refer to Hibernate EntityManager documentation?

From what I understand, JPA does not support criteria query yet,is that correct?

Does JPA support querying of stored procedures?

Is Hibernate Query Language more powerful than EJB QL?

Do you come across any deployment of application that build based on JPA and deploy onto Oracle Application server? Actually I want to know if this is possible before I know Hibernate, we were on Oracle platform.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 7:20 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
jbchurn wrote:
What if I just want to use JPA which is implemented through Hibernate EntityManager but I don't want to implement EJB?

In this case, can I use Tomcat alone? do I still need to use an embaddable ejb3 container like what alesj has suggested in earlier posting.

Please advise.


As I said you can use Tomcat and JPA alone, but it's a stupid idea in my opinion.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 9:17 am 
Regular
Regular

Joined: Wed Apr 12, 2006 12:49 am
Posts: 105
Location: Malaysia
Thanks for your comment.

You commented it's not a wise idea, what if we use Jboss with JPA alone, instead of Tomcat with JPA?

You mentioned so mainly because Tomcat is not JAVA EE server, not because I mentioned I intend to use JPA alone without EJB3 (session or message driven beans) right?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 16, 2006 10:29 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
jbchurn wrote:
Thanks for your comment.

You commented it's not a wise idea, what if we use Jboss with JPA alone, instead of Tomcat with JPA?

You mentioned so mainly because Tomcat is not JAVA EE server, not because I mentioned I intend to use JPA alone without EJB3 (session or message driven beans) right?


Because you won't use EJB 3 session beans hence not benefit from the entity manager transparent opening and closing.
Because you won't use JavaEE 5 and you'll have to add some second class implementations of a connection pool, JTA transaction, JMS provider and so one while you application will grow.

_________________
Emmanuel


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