Results 1 to 4 of 4

Thread: J2EE without EJB & transaction

  1. #1
    Join Date
    Aug 2004
    Posts
    203

    Default J2EE without EJB & transaction

    Hello,
    I read J2EE without EJB.In chapter 9 (transaction) is assert :
    When we request distributed database , we have to use JTA

    It isn't complete correct.
    With Oracle (> ver 7) we have distributed transaction and 2pc with simple JDBC (and any client)
    We havn't to have Oracle RAC - it exists in standard database, RAC isn't for distributed transaction - it is if more processes (processors) access to one databases - cluster or parallel access

    For example :

    database1 have table 1
    database2 have table2

    We can make database link on database1 on table2 on database2 and transaction is :

    connect to database1
    begin transaction
    update table1
    update table2@database
    commit

    For distributed transaction in Jva we have to have only simple JDBC (or for instance hibernate wthout JTA)

    We can make synonym on database1 to table2 on database2 and access to tables is transparent - we haven't to know where is table and transaction can be like :

    connect to database1
    begin transaction
    update table1
    update table2
    commit

    table1 and table2 are on differnet database (can be different computers) and transaction is distributed without J2ee server - oracle do distributed work for us)

    regards

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    Good point.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  3. #3
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    It is a valid point - you can have distributed transactions without using JTA. In this case you are using Oracle's built in transaction manager behind the scenes.

    However, from the Java application perspective, it looks like a single database with a single connection that just happens to have a transaction manager running within the database environment. The Java application is not using a distributed database transaction directly, so no need for JTA here.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  4. #4
    Join Date
    Aug 2004
    Posts
    203

    Default

    I talked this to hibernate forum/team and they didn't agree with me

    I think that it is valid for any database with two phase commit - it be great that postgresql have this features, but oracle is 150$/user now (standard edition)

    regards

Similar Threads

  1. Unit testing with JOTM and JtaTransactionManager
    By lalle in forum Architecture
    Replies: 1
    Last Post: Oct 15th, 2005, 09:05 AM
  2. Replies: 0
    Last Post: Jun 6th, 2005, 06:22 AM
  3. Transaction Management
    By caverns in forum Data
    Replies: 3
    Last Post: Mar 8th, 2005, 06:38 AM
  4. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM
  5. Transaction pb Hibernate/MySQL
    By syluser in forum Data
    Replies: 2
    Last Post: Aug 28th, 2004, 02:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •