Package org.apache.openjpa.lib.jdbc
Class ConfiguringConnectionDecorator
java.lang.Object
org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator
- All Implemented Interfaces:
ConnectionDecorator
Connection decorator that can configure some properties of the
underlying connection. Understands the following properties:
- QueryTimeout
- TransactionIsolation(
Connection
constants) - AutoCommit
- Author:
- Abe White
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Decorator to configure connection components correctly. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecorate
(Connection conn) Decorate the given connection if desired.Whether auto commit should be on.int
The number of seconds to wait for a query to execute before terminating it.int
The transaction isolation level.void
setAutoCommit
(Boolean autoCommit) Whether auto commit should be on.void
setQueryTimeout
(int timeout) The number of seconds to wait for a query to execute before terminating it.void
setTransactionIsolation
(int isolation) The transaction isolation level.
-
Constructor Details
-
ConfiguringConnectionDecorator
public ConfiguringConnectionDecorator()
-
-
Method Details
-
getQueryTimeout
public int getQueryTimeout()The number of seconds to wait for a query to execute before terminating it. -
setQueryTimeout
public void setQueryTimeout(int timeout) The number of seconds to wait for a query to execute before terminating it. -
getTransactionIsolation
public int getTransactionIsolation()The transaction isolation level. -
setTransactionIsolation
public void setTransactionIsolation(int isolation) The transaction isolation level. -
getAutoCommit
Whether auto commit should be on. Use null to keep the connection's default setting. Defaults to null. -
setAutoCommit
Whether auto commit should be on. Use null to keep the connection's default setting. Defaults to null. -
decorate
Description copied from interface:ConnectionDecorator
Decorate the given connection if desired.- Specified by:
decorate
in interfaceConnectionDecorator
- Throws:
SQLException
-