|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TransactionFactory
Interface to encapsulate transaction activities. Transaction factory is here to implement the Abstract Factory pattern as described in http://homepage.mac.com/loeffler/java/patterns/absfac.html by GoF95 http://homepage.mac.com/loeffler/java/patterns.html. There are different types of transactions. Some may include just the persistance layer, some may include the even the actions executed at some higher layer. This interface provides standard way how to access the transaction abstraction regardless of how the transaction manager is implemented. One may wonder why the TransactionFactory is not part of persistence layer and instead it is in utility package. The reason is that transaction is a logical unit of work which may include other activities than just persisting piece of data. For example sending of a message may be part of transaction. If then the message should be rollbacked, the client needs to have ability to establish transaction, which allows rollbacking of action (of sending data) rather than action of persisting the message.
| Method Summary | |
|---|---|
javax.transaction.TransactionManager |
getTransactionManager()
Get transaction manager for this factory. |
javax.transaction.UserTransaction |
requestTransaction()
Get transaction object which we can use to begin/commit/rollback transactions. |
void |
reset()
This method is here mainly for testing and it should reset the transaction manager to initial status to that tests can start from known environment instead of being influenced by other tests. |
void |
stop()
Stop the transaction factory. |
| Method Detail |
|---|
javax.transaction.UserTransaction requestTransaction()
throws OSSException
OSSException - - an error has occuredjavax.transaction.TransactionManager getTransactionManager()
void reset()
throws OSSException
OSSException - - an error has occured during reset
void stop()
throws OSSException
OSSException - - problem stoping transaction factory.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||