aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB Transactions inWeblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Transactions inWeblogic" Watch "EJB Transactions inWeblogic" New topic
Author

EJB Transactions inWeblogic

S Subramonyan
Ranch Hand

Joined: Aug 26, 2004
Posts: 52
Hi,

I just started learning EJB. But my employer said, I should go straight to Transactions so that he could get me a project soon. So what I did was, I created some Sessions Beans, Entity Beans etc first. Now I want to do a simple EJB project that makes use of Transactions. Could anyone please give me some sample code / ideas so that I can build a simple transaction-based EJBProject to start learning? In fact I tried on my own, but it failed. Exceptions are overflowing!!! :-)

I use Weblogic. Anything particular to Weblogic is greatly appreciated.

Thank you very much.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Um .... transactions are provided by your EJB container. You can't create an EJB project without transactions.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Originally posted by S Subramonyan:
I understand, there are both Container-managed and Bean Managed. Bean Managed you write explicit code, right?

Yes, that is correct. With container-managed transactions (CMT), you tag each method (either in the deployment descriptor or via a tool like XDoclet which results in the same thing) with a transaction attribute that tells the container how to involve the method transactionally.

With bean-managed transactions (BMT) you do all that work yourself. The result is the same (you either start or do not start a transaction), but with BMT you have complete control along with full responsibility. For this you'll work directly with a UserTransaction (begin, commit and rollback methods).

All of the above is covered in detail in the EJB specification and in many books and online resources. If you are not using XDoclet already, I recommend looking into it. Basically, it generates your deployment descriptors using JavaDoc tags in your source code.

Finally, after skimming some resources, come back and ask specific questions that we can answer. While I could paste a portion of one of my deployment descriptors, it would be utterly meaningless without some background.

I have found Rod Johnson's books Expert One-on-One J2EE Development (both with and without EJB) to be very good, clear and concise, and backed up with experience that matches my own.
S Subramonyan
Ranch Hand

Joined: Aug 26, 2004
Posts: 52
In fact what I meant was, some sample code to demonstrate the transaction mechanism. From the theory that I read, I understand, there are both Container-managed and Bean Managed. Bean Managed you write explicit code, right?

If some one please help me out here, that would be just great!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB Transactions inWeblogic