What is a transaction ...

Discussions

EJB design: What is a transaction ...

  1. What is a transaction ... (2 messages)

    Hi !
    Could anyone explain in a simpler way of what is a transaction and how it is maintained in weblogic ???

    Thanks
    AJP
  2. What is a transaction ...[ Go to top ]

    A transaction is a set of statements in which they should be executed all or none.
       that means if transaction is completed means all statements r executed , if at all any problem occurs in the middle none of them should be executed.

        weblogic maintains transactions in two ways depending on the "transaction-type" value that u have specified in
    ejb-jar file.(CMT and BMT)
            Container Managed Transaction - CMT
            Bean Managed Transaction - BMT
        there is a lot more to explain about this question. better u refer EJB secification or any book on EJB..

  3. What is a transaction ...[ Go to top ]

    Transactions are atomic units of work.

    For instance.

    Debit my account by $100 and credit yours by $100.

    Either both operations should occur, or neither. It would not be good if I was $100 down but it never made it to you.

    They have other characteristics, like isolation, consistency, durability etc. (ACID is the acronym. If you search for this along with transaction at google then you'll find loads of information.)

    Theoretically, you shouldn't care how WebLogic handles these. All you need to do is pull a UserTransaction from JNDI and then start using it.

    Within J2EE you can leave transactionality to the server (container managed) or you can do it yourself (bean managed.)

    With entity beans that last statement is false, you can't do BMT, it's part of the spec. It's late, I'm tired and I can't remember why! :-)

    Hope that helps.

    Chz

    Tony