| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jaffa.persistence.engines.jdbcengine.datasource.PersistentTransaction
This class is used to hold a connection to the database. It holds collections of objects to be added, updated, deleted or queried. The UOW will add objects to these collections. The JdbcBridge will utilise the collections to perform the relevant operations. It is important to invoke the close() method, which will free up the pooled connection.
| Constructor Summary | |
| PersistentTransaction(Database database)Creates a PersitentTransaction. | |
| Method Summary | |
|  void | addObject(IPersistent object)Adds an object to the transaction to be written. | 
|  void | close()This will free up the underlying pooled connection. | 
|  void | commit()Commits all changes executed against the persistent store. | 
|  void | deleteObject(IPersistent object)Adds an object to the transaction to be deleted. | 
|  Collection | getAdds()Returns a Collection of Persistent objects to be added to the persistent store. | 
|  DataSource | getDataSource()Returns the DataSource holding the Connection. | 
|  Collection | getDeletes()Returns a Collection of Persistent objects to be deleted from the persistent store. | 
|  Collection | getQueries()Returns a Collection of Criteria objects to be used for querying the persistent store. | 
|  Collection | getUpdates()Returns a Collection of Persistent objects to be updated in the persistent store. | 
|  void | queryObject(Criteria object)Adds a Criteria object to the transaction for performing a query. | 
|  void | rollback()Rollback the changes executed against the persistent store. | 
|  void | updateObject(IPersistent object)Adds an object to the transaction to be updated. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public PersistentTransaction(Database database)
                      throws DataSourceCreationException
database - The object with the requisite information for acquiring a Connection to the database.
DataSourceCreationException - if the connection could not be acquired.| Method Detail | 
public void addObject(IPersistent object)
               throws AddFailedException,
                      IllegalPersistentStateRuntimeException
object - the object to be created.
AddFailedException - if any error occurs during the validation of the persistent object.
IllegalPersistentStateRuntimeException - this RuntimeException will be thrown if the domain object has been submitted to the UOW for an Add/Update/Delete and commit hasnt yet been performed.
public void updateObject(IPersistent object)
                  throws UpdateFailedException,
                         IllegalPersistentStateRuntimeException
object - the object to be updated.
UpdateFailedException - if any error occurs during the validation of the persistent object.
IllegalPersistentStateRuntimeException - this RuntimeException will be thrown if the domain object has been submitted to the UOW for an Add/Update/Delete and commit hasnt yet been performed.
public void deleteObject(IPersistent object)
                  throws DeleteFailedException,
                         IllegalPersistentStateRuntimeException
object - the object to be deleted.
DeleteFailedException - if any error occurs during the process.
IllegalPersistentStateRuntimeException - this RuntimeException will be thrown if the domain object has been submitted to the UOW for an Add/Update/Delete and commit hasnt yet been performed.public void queryObject(Criteria object)
object - the Criteria based on which a query is to be performed.
public void commit()
            throws SQLException
SQLException - if any database error occurs.
public void rollback()
              throws SQLException
SQLException - if any database error occurs.
public void close()
           throws SQLException
SQLException - if any database error occurs.public DataSource getDataSource()
public Collection getAdds()
public Collection getUpdates()
public Collection getDeletes()
public Collection getQueries()
| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||