01: /**
02: * Copyright (C) 2001-2005 France Telecom R&D
03: */package org.objectweb.speedo.workingset.api;
04:
05: import org.objectweb.perseus.persistence.api.ConnectionHolder;
06: import org.objectweb.perseus.persistence.api.PersistenceException;
07: import org.objectweb.perseus.persistence.api.TransactionalWorkingSet;
08: import org.objectweb.speedo.pm.api.POManagerItf;
09:
10: /**
11: * Defines the transaction concept. It offers
12: * - demarcation methods (begin, commit rollback)
13: * - status checking
14: * - management of the connection to the underlying data support
15: *
16: * @author S.Chassande-Barrioz
17: */
18: public interface TransactionItf extends TransactionalWorkingSet {
19:
20: /**
21: * @return boolean value indicating if the transaction is active or not.
22: */
23: boolean isActive();
24:
25: /**
26: * Starts the transaction.
27: * @throws SpeedoRuntimeException If the transaction is already started
28: */
29: void begin();
30:
31: /**
32: * Commits the transaction.
33: * @throws SpeedoRuntimeException If the commit process fails
34: */
35: void commit();
36:
37: /**
38: * Rolles back the transaction.
39: * @throws SpeedoRuntimeException If the rollback process fails
40: */
41: void rollback();
42:
43: /**
44: * It activates the working set. This is used to delimit the begining of
45: * the working set.
46: */
47: void activate() throws PersistenceException;
48:
49: /**
50: * Indicates if the transaction environnement is managed. If the 'false'
51: * value is returned then that means that a user transaction matches to
52: * a local transaction managed by speedo.
53: */
54: boolean isManagedEnv();
55:
56: /**
57: * Assignes the connection holder. The connection holder is able to allocate
58: * a connection to the underlying data support and to kept it until the
59: * working set / transaction end.
60: */
61: void setConnectionHolder(ConnectionHolder ch);
62:
63: /**
64: * Marks the current transaction as rollback only. this means that the
65: * transaction cannot be committed
66: */
67: void setRollbackOnly();
68:
69: /**
70: * @return the rollback only flag.
71: */
72: boolean getRollbackOnly();
73:
74: RuntimeException rollBackOnInternalError(Exception e);
75:
76: POManagerItf getPOManager();
77: }
|