01: /*
02: * Helma License Notice
03: *
04: * The contents of this file are subject to the Helma License
05: * Version 2.0 (the "License"). You may not use this file except in
06: * compliance with the License. A copy of the License is available at
07: * http://adele.helma.org/download/helma/license.txt
08: *
09: * Copyright 1998-2003 Helma Software. All Rights Reserved.
10: *
11: * $RCSfile$
12: * $Author: root $
13: * $Revision: 8604 $
14: * $Date: 2007-09-28 15:16:38 +0200 (Fre, 28 Sep 2007) $
15: */
16:
17: package helma.objectmodel;
18:
19: /**
20: * This interface is kept for databases that are able
21: * to run transactions.
22: */
23: public interface ITransaction {
24:
25: public final int ADDED = 0;
26: public final int UPDATED = 1;
27: public final int DELETED = 2;
28:
29: /**
30: * Complete the transaction by making its changes persistent.
31: */
32: public void commit() throws DatabaseException;
33:
34: /**
35: * Rollback the transaction, forgetting the changed items
36: */
37: public void abort() throws DatabaseException;
38:
39: /**
40: * Adds a resource to the list of resources encompassed by this transaction
41: *
42: * @param res the resource to add
43: * @param status the status of the resource (ADDED|UPDATED|DELETED)
44: */
45: public void addResource(Object res, int status)
46: throws DatabaseException;
47: }
|