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.transaction;
17:
18: import javax.sql.DataSource;
19: import java.sql.Connection;
20: import java.sql.SQLException;
21:
22: /**
23: * Extension to the <code>DataSource</code> interface that allows for retrieving transaction aware connections.
24: * For example a connection can be returned that hooks into Spring's transaction management.
25: * <p/>
26: * Tests should typically do their own connection handling instead of using these transactional connections.
27: *
28: * @author Tim Ducheyne
29: * @author Filip Neven
30: */
31: public interface TransactionalDataSource extends DataSource {
32:
33: /**
34: * Retrieves a connection that can participate in a transaction.
35: *
36: * @return The connection, not null
37: */
38: public Connection getTransactionalConnection() throws SQLException;
39:
40: }
|