| Sign In/My Account | View Cart |
| Article: |
Bean-Managed Transaction Suspension in J2EE | |
| Subject: | Point? | |
| Date: | 2005-07-22 09:44:39 | |
| From: | maximdim | |
|
Response to: Point?
|
||
|
the nonportability can come about because certain appservers might have restrictions on the methods you can use on the exposed Transaction Manager. As long as it's not a standard one can never be safe in assuming it.
|
||
Showing messages 1 through 3 of 3.
I am using POJO Entities that coordinate with JPA and UserTransaction for ORM. On top of that, I want POJO DAOs that emulate CMT.
I do not want EJBs. I do not need to remote my objects. I do not want to write tons of interfaces and classes for every DAO. No thanks.
My POJO DAOs will use my own custom Annotations that emulate javax.ejb.TransactionAttribute. Using Spring and AspectJ and advice in this article, I now have an idea of how to write my advice blocks.
And THAT is the point. I don't want to sacrifice the ease of declarative transaction demarcation just because my software needs do not justify the heavyness of the rest of EJBs.
Instead of going through all this stupid trouble to write non-standard code and to use hidden APIs one ought to just follow the EJB spec and use the transaction setting of "NotSupported" or "Never" then the developer will have portable code that works on any J2EE app server. Advocating to write directly to the TM is foolish and shows lack of experience. We lived through the days when people used hidden DOS 21h functions and seeing code break with new versions of DOS. This article does nothing more than advocate the same mistakes people made 20 years ago.
Stick to using EJBs they way they are meant to be used and you can have portable, transactional code just like is needed by the use cases stated and one does not have to take unnecessary risks to write code that will break one day (probably when a fix or new version is applied).