Syncpoint issues for DriverManager with explicit and default URLs

When a Java™ application for CICS® that uses JDBC or SQLJ acquires a connection using an explicit URL, it operates in an environment similar to that of a DPL server program linked to with the SYNCONRETURN attribute.

When an application program that uses JDBC or SQLJ closes the explicit URL connection, if CICS is using the IBM® Data Server Driver for JDBC and SQLJ, no implicit syncpoint is taken.

However, the close of an explicit URL connection is only successful when on a unit of work boundary. The application must therefore take a syncpoint, by issuing a JDBC or SQLJ commit method call or a JCICS commit, before closing the connection. (The application could use autocommit(true) to ensure that a syncpoint is taken, but the use of this property is discouraged in the CICS environment.) When the application program closes an explicit URL connection, that is the end of the unit of work.

You can overcome this restriction by acquiring the connection using a default URL instead of an explicit URL, or by using a data source that provides a default URL connection (see Acquiring a connection to a database). When a default URL is used, the Java application does not have to close the connection on a unit of work boundary, and no syncpoint is taken when the connection is closed (provided that autocommit(true) has not been specified).

It is recommended that you always use default URL connections when using DriverManager type 2 connectivity.