Tabnine Logo
TransactionException.multipleResourceException
Code IndexAdd Tabnine to your IDE (free)

How to use
multipleResourceException
method
in
org.eclipse.persistence.exceptions.TransactionException

Best Java code snippets using org.eclipse.persistence.exceptions.TransactionException.multipleResourceException (Showing top 1 results out of 315)

origin: com.haulmont.thirdparty/eclipselink

public Connection getConnection(DataSourceImpl ds, String user, String password) throws SQLException {
  // We don't have a datasource connection yet, so allocate one
  if (connection == null) {
    debug("TxImpl - allocating new connection");
    dataSource = ds;
    connection = ds.internalGetConnection(user, password);
    connection.setAutoCommit(false);
  } else {
    // We already have a connection. Make sure the data sources are the same.
    if (ds.getName() != dataSource.getName()) {
      throw TransactionException.multipleResourceException();
    }
  }
  //  return connection;
  // Allocate and return a proxy for the connection
  debug("TxImpl - creating connection proxy");
  Connection proxyConnection = null;
  try {
    InvocationHandler handler = new ConnectionProxyHandler(connection);
    proxyConnection = (Connection)proxyClass.getConstructor(new Class[] { InvocationHandler.class }).newInstance(new Object[] { handler });
  } catch (Exception ex) {
    throw TransactionException.internalProxyException(ex);
  }
  return proxyConnection;
}
org.eclipse.persistence.exceptionsTransactionExceptionmultipleResourceException

Popular methods of TransactionException

  • <init>
  • errorBeginningExternalTransaction
  • errorBindingToExternalTransaction
  • errorCommittingExternalTransaction
  • errorGettingExternalTransaction
  • errorGettingExternalTransactionStatus
  • errorMarkingTransactionForRollback
  • errorObtainingTransactionManager
  • errorRollingBackExternalTransaction
  • externalTransactionNotActive
  • inactiveUnitOfWork
  • jndiLookupException
  • inactiveUnitOfWork,
  • jndiLookupException,
  • setErrorCode,
  • setInternalException,
  • getErrorCode,
  • entityTransactionWithJTANotAllowed,
  • getMessage,
  • internalProxyException,
  • transactionIsActive

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now