com.imaginary.lwp
Class JDBCTransactionImpl

java.lang.Object
  |
  +--com.imaginary.lwp.Transaction
        |
        +--com.imaginary.lwp.JDBCTransactionImpl

public class JDBCTransactionImpl
extends Transaction
implements JDBCTransaction

Implements the Transaction interface for support of JDBC transactions.
Last modified $Date: 1999/10/06 21:08:56 $

Version:
$Revision: 1.1 $
Author:
George Reese (borg@imaginary.com)

Constructor Summary
JDBCTransactionImpl()
          Constructs a new transaction.
 
Method Summary
 void commit()
          Sends a commit to the connection currently in use.
 java.sql.Connection getConnection()
          Provides a JDBC Connection object to the persistence handler implementing a persistence for a business object.
 void rollback()
          Tells the current connection to rollback.
 
Methods inherited from class com.imaginary.lwp.Transaction
begin, end, getCurrent, getIdentifier, getTimestamp, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCTransactionImpl

public JDBCTransactionImpl()
Constructs a new transaction.
Method Detail

commit

public void commit()
            throws PersistenceException
Sends a commit to the connection currently in use.
Specified by:
commit in interface JDBCTransaction
Throws:
PersistenceException - the commit failed
Overrides:
commit in class Transaction

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Provides a JDBC Connection object to the persistence handler implementing a persistence for a business object. This method finds the connection by loading a DataSource from a JNDI directory and asking the data source for the connection. The data source name should be provided in the imaginary.lwp.dataSouceName system property.
Specified by:
getConnection in interface JDBCTransaction
Returns:
the JDBC Connection
Throws:
java.sql.SQLException - an error occurred creating the connection from the data source

rollback

public void rollback()
              throws PersistenceException
Tells the current connection to rollback.
Specified by:
rollback in interface JDBCTransaction
Throws:
PersistenceException - the rollback failed
Overrides:
rollback in class Transaction