-->
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: EJB 3.0 JPA Fallback in case of troubles?
PostPosted: Tue Aug 26, 2008 7:19 am 
Newbie

Joined: Tue Aug 26, 2008 7:01 am
Posts: 12
Location: Zuerich, Switzerland
Hi folks

I did not find any thred covering my topics yet but if I didn't catch one please redirect me to this ;-)

I am actually evaluating the possibilities of an EJB 3.0 JPA usage in a new project.

During the last 1 - 2 years we used hibernate in more and more IT project in a scenario as follows:
Fat Client -> EJB 2.0 Application (running on Weblogic) using Hibernate as ORM tool and Oracle DB.

The basic architectural scenario we're considering is the same but we're seriously thinking about using EJB 3.0 JPA Entities to get on a Standard API. But we're a little bit concerned about the settlement and experience with JPA in the market (in our corp we have serious J2EE EJB 2.0 experience but now EJB 3.0 as we're just about evaluating ;-) )

We now that we get good solutions based on the plain old hibernate. Now we're thinking about the possibilities we have if we get in troubles with the JPA API.

Can somebody of you give me some insights to the following questions and maybe further documentation links pointing to more information regarding the following:
1) How fare is the JPA API away from the plain old hibernate API?

2) Is it true (I mean I saw different posts to this but can't really imagine how this should go) to use EJB 3.0 JPA and the Core Hibernate API next to each other? What are the criterias to be considered and taken care for when developing / in design to use this possibilities?

3) How would you expect the effort if we get in a show Stopper with EJB 3.0 JPA (Hibernate) to switch over to plain old Hibernate Usage without EJB 3.0 Entities? Are the differences and the necessary changes big?

4) Is there any documentation around for this beside the normal API Doc of the Core and JPA? If not does anybody have a proposal how to compare this two in my opinion not very related API's to each other to gain some feeling for the necessary changes in case of troubles?

Regards & Thanks in advance


Top
 Profile  
 
 Post subject: Re: EJB 3.0 JPA Fallback in case of troubles?
PostPosted: Wed Aug 27, 2008 4:41 pm 
Pro
Pro

Joined: Tue Jun 12, 2007 4:13 am
Posts: 209
Location: Berlin, Germany
smiley2360 wrote:
Now we're thinking about the possibilities we have if we get in troubles with the JPA API.

What makes you think of this? EJB3/JPA (and it's providers like Hibernate) are far away from EJB 1 and 2.

Quote:
1) How fare is the JPA API away from the plain old hibernate API?

Well, on the interface / API level, there it seems relative far away; but in fact, JPA is just a thin layer on Hibernate core and the main functionalities just have a simple mapping.
Quote:

2) Is it true (I mean I saw different posts to this but can't really imagine how this should go) to use EJB 3.0 JPA and the Core Hibernate API next to each other? What are the criterias to be considered and taken care for when developing / in design to use this possibilities?

I think, normally you shouldn't mix the APIs. And, generally speaking, you should use standards and not propietary APIs - King/Bauer also say this. The design question is just another thing: it depends for instance if you are using a full application server or just a web server.

Quote:
3) How would you expect the effort if we get in a show Stopper with EJB 3.0 JPA (Hibernate) to switch over to plain old Hibernate Usage without EJB 3.0 Entities? Are the differences and the necessary changes big?

You won't get a show stopper just because you decided to use JPA / EJB3. You can get show stoppers also by just using plain Hibernate - it's a question of your design and your code. And: if you get show stoppers it would be a bad idea to completely change APIs!

Anyway: JPA has a backdoor to let you use the native API of your JPA provider. EntityManager has a getDelegate method which would get you the Hibernate session. So, in some rare cases, you might ressort to this.

Quote:
4) Is there any documentation around for this beside the normal API Doc of the Core and JPA? If not does anybody have a proposal how to compare this two in my opinion not very related API's to each other to gain some feeling for the necessary changes in case of troubles?

Well, just read the Hibernate/JPA book from King/Bauer. They always describe both levels and APIs (and give you recommendations). Besides - believe it or not - Hibernate API and JPA API are very close. Remember Hibernate (and Gavin King) was one of the fathers of JPA.

_________________
Carlo
-----------------------------------------------------------
please don't forget to rate if this post helped you


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.