From d479253768d296a40b4f699e1de9b03c7146a97a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Dec 2013 14:03:28 -0800 Subject: Adding javadocs and Carbonado User Guide --- .../repo/jdbc/JDBCConnectionCapability.html | 370 +++++++++++++++++++++ 1 file changed, 370 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/repo/jdbc/JDBCConnectionCapability.html (limited to 'apidocs/com/amazon/carbonado/repo/jdbc/JDBCConnectionCapability.html') diff --git a/apidocs/com/amazon/carbonado/repo/jdbc/JDBCConnectionCapability.html b/apidocs/com/amazon/carbonado/repo/jdbc/JDBCConnectionCapability.html new file mode 100644 index 0000000..9198bd4 --- /dev/null +++ b/apidocs/com/amazon/carbonado/repo/jdbc/JDBCConnectionCapability.html @@ -0,0 +1,370 @@ + + + + + + +JDBCConnectionCapability (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado.repo.jdbc
+

Interface JDBCConnectionCapability

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Capability
    +
    +
    +
    All Known Subinterfaces:
    +
    JDBCSupport<S>
    +
    +
    +
    +
    public interface JDBCConnectionCapability
    +extends Capability
    +
    Capability to directly access the JDBC connection being used by the current + transaction, which is thread-local. If no transaction is in progress, then + the connection is in auto-commit mode. + +

    All connections retrieved from this capability must be properly + yielded. Do not close the connection directly, as this interferes with the + transaction's ability to properly manage it. + +

    It is perfectly okay for other Carbonado calls to be made while the + connection is in use. Also, it is okay to request more connections, + although they will usually be the same instance. Failing to yield a + connection has an undefined behavior. + +

    + JDBCConnectionCapability cap = repo.getCapability(JDBCConnectionCapability.class);
    + Transaction txn = repo.enterTransaction();
    + try {
    +     Connection con = cap.getConnection();
    +     try {
    +         ...
    +     } finally {
    +         cap.yieldConnection(con);
    +     }
    +     ...
    +     txn.commit();
    + } finally {
    +     txn.exit();
    + }
    + 
    +
    Author:
    +
    Brian S O'Neill
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      java.sql.ConnectiongetConnection() +
      Any connection returned by this method must be closed by calling + yieldConnection.
      +
      java.lang.StringgetDatabaseProductName() +
      Returns the name of the database product connected to.
      +
      booleanisTransactionForUpdate() +
      Returns true if a transaction is in progress and it is for update.
      +
      booleanisUniqueConstraintError(java.sql.SQLException e) +
      Examines the SQLSTATE code of the given SQL exception and determines if + it is a unique constaint violation.
      +
      FetchExceptiontoFetchException(java.lang.Throwable e) +
      Transforms the given throwable into an appropriate fetch exception.
      +
      PersistExceptiontoPersistException(java.lang.Throwable e) +
      Transforms the given throwable into an appropriate persist exception.
      +
      voidyieldConnection(java.sql.Connection con) +
      Gives up a connection returned from getConnection.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getConnection

        +
        java.sql.Connection getConnection()
        +                                  throws FetchException
        +
        Any connection returned by this method must be closed by calling + yieldConnection.
        +
        Throws:
        +
        FetchException
        +
      • +
      + + + +
        +
      • +

        yieldConnection

        +
        void yieldConnection(java.sql.Connection con)
        +                     throws FetchException
        +
        Gives up a connection returned from getConnection. Connection must be + yielded in same thread that retrieved it.
        +
        Throws:
        +
        FetchException
        +
      • +
      + + + +
        +
      • +

        toFetchException

        +
        FetchException toFetchException(java.lang.Throwable e)
        +
        Transforms the given throwable into an appropriate fetch exception. If + it already is a fetch exception, it is simply casted.
        +
        Parameters:
        e - required exception to transform
        +
        Returns:
        FetchException, never null
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        toPersistException

        +
        PersistException toPersistException(java.lang.Throwable e)
        +
        Transforms the given throwable into an appropriate persist exception. If + it already is a persist exception, it is simply casted.
        +
        Parameters:
        e - required exception to transform
        +
        Returns:
        PersistException, never null
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        isUniqueConstraintError

        +
        boolean isUniqueConstraintError(java.sql.SQLException e)
        +
        Examines the SQLSTATE code of the given SQL exception and determines if + it is a unique constaint violation.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        isTransactionForUpdate

        +
        boolean isTransactionForUpdate()
        +
        Returns true if a transaction is in progress and it is for update.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        getDatabaseProductName

        +
        java.lang.String getDatabaseProductName()
        +
        Returns the name of the database product connected to.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.

+ + -- cgit v1.2.3