arminw 2005/07/24 16:39:42
Modified: src/java/org/apache/ojb/broker/accesslayer Tag:
OJB_1_0_RELEASE ConnectionFactoryManagedImpl.java
src/java/org/apache/ojb/broker/platforms Tag:
OJB_1_0_RELEASE PlatformDefaultImpl.java
Log:
deprecate specific ConnectionFactory impl for managed environments - no
longer needed.
minor changes when initialize the connections in Platform class
Revision Changes Path
No revision
No revision
1.4.2.2 +3 -1
db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryManagedImpl.java
Index: ConnectionFactoryManagedImpl.java
===================================================================
RCS file:
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryManagedImpl.java,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -r1.4.2.1 -r1.4.2.2
--- ConnectionFactoryManagedImpl.java 26 Apr 2005 03:41:35 -0000 1.4.2.1
+++ ConnectionFactoryManagedImpl.java 24 Jul 2005 23:39:42 -0000 1.4.2.2
@@ -23,6 +23,8 @@
/**
* ConnectionFactory for use in managed environments - eg JBoss.
*
+ * @deprecated no longer needed to specify a specific
<em>ConnectionFactory</em> class in
+ * managed environments.
* @author <a href="mailto:[EMAIL PROTECTED]">Armin Waibel</a>
* @version $Id$
*/
No revision
No revision
1.27.2.4 +42 -48
db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformDefaultImpl.java
Index: PlatformDefaultImpl.java
===================================================================
RCS file:
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformDefaultImpl.java,v
retrieving revision 1.27.2.3
retrieving revision 1.27.2.4
diff -u -r1.27.2.3 -r1.27.2.4
--- PlatformDefaultImpl.java 27 Apr 2005 00:23:52 -0000 1.27.2.3
+++ PlatformDefaultImpl.java 24 Jul 2005 23:39:42 -0000 1.27.2.4
@@ -145,54 +145,56 @@
public void initializeJdbcConnection(JdbcConnectionDescriptor jcd,
Connection conn) throws PlatformException
{
if (jcd.getBatchMode()) checkForBatchSupport(conn);
- /*
- arminw:
- workaround to be backward compatible. In future releases we
shouldn't change the autocommit
- state of a connection at initializing by the ConnectionFactory. The
autocommit state should only be
- changed by the ConnectionManager. We have to separate this stuff.
- */
- if(!jcd.getAttribute(INITIALIZATION_CHECK_AUTOCOMMIT,
FALSE_STR).equalsIgnoreCase(FALSE_STR))
+
+ switch (jcd.getUseAutoCommit())
{
- switch (jcd.getUseAutoCommit())
- {
- case JdbcConnectionDescriptor.AUTO_COMMIT_IGNORE_STATE:
- // nothing to do
- break;
- case
JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE:
- try
+ case JdbcConnectionDescriptor.AUTO_COMMIT_IGNORE_STATE:
+ // nothing to do
+ break;
+ case
JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE:
+ try
+ {
+ /*
+ arminw:
+ workaround to be backward compatible. In future releases
we shouldn't change the autocommit
+ state of a connection at initializing by the
ConnectionFactory. The autocommit state should
+ only be changed by the ConnectionManager. We have to
separate this stuff.
+ */
+ if (!jcd.getAttribute(INITIALIZATION_CHECK_AUTOCOMMIT,
FALSE_STR).equalsIgnoreCase(FALSE_STR)
+ && !conn.getAutoCommit())
{
- if (!conn.getAutoCommit()) conn.setAutoCommit(true);
+ conn.setAutoCommit(true);
}
- catch (SQLException e)
+ }
+ catch (SQLException e)
+ {
+ if (!jcd.isIgnoreAutoCommitExceptions())
{
- if (!jcd.isIgnoreAutoCommitExceptions())
- {
- throw new PlatformException("Connection
initializing: setAutoCommit(true) failed", e);
- }
- else
- {
- log.info("Connection initializing: setAutoCommit
jdbc-driver problems. " + e.getMessage());
- }
+ throw new PlatformException("Connection
initializing: setAutoCommit(true) failed", e);
}
- break;
- case JdbcConnectionDescriptor.AUTO_COMMIT_SET_FALSE:
- try
+ else
+ {
+ log.info("Connection initializing: setAutoCommit
jdbc-driver problems. " + e.getMessage());
+ }
+ }
+ break;
+ case JdbcConnectionDescriptor.AUTO_COMMIT_SET_FALSE:
+ try
+ {
+ if (conn.getAutoCommit()) conn.setAutoCommit(false);
+ }
+ catch (SQLException e)
+ {
+ if (!jcd.isIgnoreAutoCommitExceptions())
{
- if (conn.getAutoCommit()) conn.setAutoCommit(false);
+ throw new PlatformException("Connection
initializing: setAutoCommit(false) failed", e);
}
- catch (SQLException e)
+ else
{
- if (!jcd.isIgnoreAutoCommitExceptions())
- {
- throw new PlatformException("Connection
initializing: setAutoCommit(false) failed", e);
- }
- else
- {
- log.info("Connection initializing: setAutoCommit
jdbc-driver problems. " + e.getMessage());
- }
+ log.info("Connection initializing: setAutoCommit
jdbc-driver problems. " + e.getMessage());
}
- break;
- }
+ }
+ break;
}
}
@@ -423,14 +425,6 @@
}
/**
- * @see
org.apache.ojb.broker.platforms.Platform#isCallableStatement(java.sql.PreparedStatement)
- */
- public boolean isCallableStatement(PreparedStatement stmt)
- {
- return stmt instanceof CallableStatement;
- }
-
- /**
* @see
org.apache.ojb.broker.platforms.Platform#registerOutResultSet(java.sql.CallableStatement,
int)
*/
public void registerOutResultSet(CallableStatement stmt, int position)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]