Transaction propogation to Java classes

Discussions

EJB programming & troubleshooting: Transaction propogation to Java classes

  1. Transaction propogation to Java classes (1 messages)

    Hi all,

    I have a question. If I have a DAO that is implemented as a simple java class. I make a connection object at my session bean and pass it to the DAO object. And the DAO object does all its operations on that connection object. Then will the DAO come into the same transaction scope as the session bean???? If not, how can I ensure that it comes into the same transaction scope. I am using Declarative Transaction Management.

    This is really urgent. Would appreciate any help,

    Thanks
    Aneesha
  2. Yes it will.
    The connection represents a session with a specific database. A transaction is associated with a single Connection object (and database).Since you are passing the same Connection object the transaction context will be passed on.

    ashutosh