Results 1 to 2 of 2

Thread: Container-managed transactions without JNDI?

  1. #1
    Join Date
    Aug 2004
    Location
    San Jose, CA
    Posts
    24

    Default Container-managed transactions without JNDI?

    Page 233 of "J2EE Development without EJB" says
    For resources to participate in container transactions, they must be configured appropriately. For JDBC, it's necessary to set up a JNDI DataSource via the ... javax.sql.XADataSource ...
    Is this a hard and fast requirement? Is it possible to get container-managed JDBC transactions without reliance on JNDI?

    - Justin Makeig

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

    Default

    Is it possible to get container-managed JDBC transactions without reliance on JNDI?
    No, if you mean transactions managed by an EJB container. To do this you need a JNDI DataSource in all cases. If you use CMT, you don't need a JNDI lookup for tx mgt, but if you use BMT you need to look up the UserTransaction object in JNDI. (Plus you'll JNDI to locate your EJB to invoke it.)

    With Spring you can have Spring-managed JDBC transactions without JNDI using DataSourceTransactionManager. If you use JtaTransactionManager there's a JNDI lookup under the covers, although you don't need to write that code.

    If you're in an app server environment, a JNDI DataSource is probably a good idea. If you're in a pure web container, using a non-JNDI DataSource often makes sense.

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

Similar Threads

  1. JDO Transactions and JUnit testing
    By markds75 in forum Data
    Replies: 2
    Last Post: Sep 17th, 2005, 01:46 AM
  2. one thread per managed bean? or per container?
    By matthias in forum Container
    Replies: 4
    Last Post: Jul 6th, 2005, 10:05 AM
  3. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  4. Replies: 1
    Last Post: Mar 23rd, 2005, 05:32 AM
  5. Replies: 8
    Last Post: Dec 7th, 2004, 06:13 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
  •