< prev index next >

src/java.sql/share/classes/java/sql/Connection.java

Print this page




1506      * marks the start of the request and subsequent calls are treated as
1507      * a no-op
1508      * <p>
1509      * Use of {@code beginRequest} and {@code endRequest} is optional, vendor
1510      * specific and should largely be transparent. In particular
1511      * implementations may detect conditions that indicate dependence on
1512      * other work such as an open transaction. It is recommended though not
1513      * required that implementations throw a {@code SQLException} if there is an active
1514      * transaction and {@code beginRequest} is called.
1515      * Using these methods may improve performance or provide other benefits.
1516      * Consult your vendors documentation for additional information.
1517      * <p>
1518      * It is recommended to
1519      * enclose each unit of work in {@code beginRequest}, {@code endRequest}
1520      * pairs such that there is no open transaction at the beginning or end of
1521      * the request and no dependency on local state that crosses request
1522      * boundaries. Committed database state is not local.
1523      *
1524      * @implSpec
1525      * The default implementation is a no-op.
1526      * <p>
1527      * @apiNote
1528      * This method is to be used by Connection pooling managers.
1529      * <p>
1530      * The pooling manager should call {@code beginRequest} on the underlying connection
1531      * prior to returning a connection to the caller.
1532      * <p>
1533      * The pooling manager does not need to call {@code beginRequest} if:
1534      * <ul>
1535      * <li>The connection pool caches {@code PooledConnection} objects</li>
1536      * <li>Returns a logical connection handle when {@code getConnection} is
1537      * called by the application</li>
1538      * <li>The logical {@code Connection} is closed by calling
1539      * {@code Connection.close} prior to returning the {@code PooledConnection}
1540      * to the cache.</li>
1541      * </ul>
1542      * @throws SQLException if an error occurs
1543      * @since 9
1544      * @see endRequest
1545      * @see javax.sql.PooledConnection
1546      */




1506      * marks the start of the request and subsequent calls are treated as
1507      * a no-op
1508      * <p>
1509      * Use of {@code beginRequest} and {@code endRequest} is optional, vendor
1510      * specific and should largely be transparent. In particular
1511      * implementations may detect conditions that indicate dependence on
1512      * other work such as an open transaction. It is recommended though not
1513      * required that implementations throw a {@code SQLException} if there is an active
1514      * transaction and {@code beginRequest} is called.
1515      * Using these methods may improve performance or provide other benefits.
1516      * Consult your vendors documentation for additional information.
1517      * <p>
1518      * It is recommended to
1519      * enclose each unit of work in {@code beginRequest}, {@code endRequest}
1520      * pairs such that there is no open transaction at the beginning or end of
1521      * the request and no dependency on local state that crosses request
1522      * boundaries. Committed database state is not local.
1523      *
1524      * @implSpec
1525      * The default implementation is a no-op.
1526      *
1527      * @apiNote
1528      * This method is to be used by Connection pooling managers.
1529      * <p>
1530      * The pooling manager should call {@code beginRequest} on the underlying connection
1531      * prior to returning a connection to the caller.
1532      * <p>
1533      * The pooling manager does not need to call {@code beginRequest} if:
1534      * <ul>
1535      * <li>The connection pool caches {@code PooledConnection} objects</li>
1536      * <li>Returns a logical connection handle when {@code getConnection} is
1537      * called by the application</li>
1538      * <li>The logical {@code Connection} is closed by calling
1539      * {@code Connection.close} prior to returning the {@code PooledConnection}
1540      * to the cache.</li>
1541      * </ul>
1542      * @throws SQLException if an error occurs
1543      * @since 9
1544      * @see endRequest
1545      * @see javax.sql.PooledConnection
1546      */


< prev index next >