01: /*
02: * Copyright 2006-2007, Unitils.org
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.unitils.database.util;
17:
18: /**
19: * Marks a module as being flushable. This means that {@link #flushDatabaseUpdates(Object)} will be called on the module
20: * when a flush is requested on the DatabaseModule (by calling its {@link #flushDatabaseUpdates(Object)} method).
21: * <p/>
22: * An example of when a module could need to be flushable is the HibernateModule. Hibernate sometimes stores
23: * updates in the session (in memory) without performing them on the database. If you want to be sure that every such
24: * update was performed on the database, you need to flush the hibernate session.
25: *
26: * @author Tim Ducheyne
27: * @author Filip Neven
28: */
29: public interface Flushable {
30:
31: /**
32: * Flush all cached database operations.
33: * @param testObject
34: */
35: void flushDatabaseUpdates(Object testObject);
36: }
|