Hi anishanc,
first of all: if you post a message here, you should be more specific in the subject title. Who might be interested in a message named "Hibernate" on the Hibernate forum?
Responding to your questions, the first thing to say is: that depends. You can use Hibernate in various ways - and you must determine who to use it.
I think the first preference should be using JPA - after all it is a standard (and the Hibernate people are in the standard comitee).
Then, if you use the JPA interfaces with Hibernate, you can always fallback to native Hibernate (Hibernate specific annotations, Hibernate specific interfaces) if you want to use special features or need special performance tuning.
The other question would be: to use EJB (and an application server like JBoss) or not. My preference is using EJB because you then have automatic transaction management and you have simpler methods.
If using EJBs the next questions would be: is your server stateful or not? Do you need "long" transactions? Do you work with "detached objects" or not?
You can see, you have a lot of design possibilities - it is up to you to decide!
_________________ Carlo
-----------------------------------------------------------
please don't forget to rate if this post helped you
|