What I want to do is create a DAO layer outside of the middle tier. Because other J2EE applications need to use the DAO layer as well. I want to share the DAO layer accross different applications that need to access the same RDBMS.
The applications are deployed as ear files. How should i deploy my DAO layer. Should I still use the session facade pattern to 'front' the dao layer and back this with Hibernate persistent business objects. If I deploy this as an ear file as well will this mean that the applications that need DB access will need to use remote interfaces to communicate with the Hibernate layer. Because of another question I asked at the ranch I think this is true under WebLogic because of the way classloaders are allocated to ear files.
I think, therefore I exist -- Rene Descartes
%
Originally posted by Valentin Tanase:
Hi Kelly,
Regards.
Devender Thareja
SCEA, SCBCD, SCJP
I think, therefore I exist -- Rene Descartes
simple POJOs that delegate basic CRUD operations to Hibernate.
That is exactly what a DAO is. So you contradict yourself. saying not to use DAOs then say that you should create POJOS as quoted above. They are one and the same thing in the definition of a DAO.
Also, EJBs are not over because of a framework like Spring. There are drawbacks to Spring, like more XML to maintain. But I am not trying to knock Spring, I love Spring and its advantages.
I think, therefore I exist -- Rene Descartes
Originally posted by Valentin Tanase:
Hi Devender,
As a matter of fact here there are (in my opinion) the most important reasons to go with EJB2.0 at this time:
Need to implement the business tier as distributed components. Providing implicit middleware services. Support for other non-web clients (RMI-IIOP). Great support for messaging. Need for a standardized component-based architecture.
Devender Thareja
SCEA, SCBCD, SCJP
However, I don't completely understand the reason 2. What you mean by implicit middleware support?
am preparing for SCBCD, and I was having doubt that should I take the trouble of studying it or not. Good to know that technology is not completely obsolete yet.
I think, therefore I exist -- Rene Descartes
My next question is what about transaction demarcation? My ejb applications use container managed transactions (WebLogic 8.1 transaction manager). Can the ejb transactions be propagated to the hibernate POJO updates? All the example Hibernate code I have seen always shows explicit COMMIT after the update. Can this be left to the container?
Also does Hibernate support XA transactions? I will need to do something like so:
begin txn ---> update Oracle RDBMS ---> add msg to JMS queue ----> commit
How can I get this working? Does Spring help with this?
Different client applications might want to include the DAO layer in transactions in different ways.
I think, therefore I exist -- Rene Descartes
Also does Hibernate support XA transactions? I will need to do something like so:
begin txn ---> update Oracle RDBMS ---> add msg to JMS queue ----> commit
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Devender Thareja
SCEA, SCBCD, SCJP
I think, therefore I exist -- Rene Descartes
My next question is what about transaction demarcation? My ejb applications use container managed transactions (WebLogic 8.1 transaction manager). Can the ejb transactions be propagated to the hibernate POJO updates? All the example Hibernate code I have seen always shows explicit COMMIT after the update. Can this be left to the container?
I think, therefore I exist -- Rene Descartes
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
I think, therefore I exist -- Rene Descartes
Did I say that?
I think, therefore I exist -- Rene Descartes
Does this tiny ad smell okay to you?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|