Codota Logo
org.postgresql.xa
Code IndexAdd Codota to your IDE (free)

How to use org.postgresql.xa

Best Java code snippets using org.postgresql.xa (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: alibaba/druid

public static XAConnection createXAConnection(Connection physicalConn) throws SQLException {
  return new PGXAConnection((BaseConnection) physicalConn);
}
origin: org.postgresql/postgresql

 private Object loadXADataSource(Reference ref) {
  PGXADataSource ds = new PGXADataSource();
  return loadBaseDataSource(ds, ref);
 }
}
origin: org.postgresql/postgresql

/**
 * Gets a connection to the PostgreSQL database. The database is identified by the DataSource
 * properties serverName, databaseName, and portNumber. The user to connect as is identified by
 * the DataSource properties user and password.
 *
 * @return A valid database connection.
 * @throws SQLException Occurs when the database connection cannot be established.
 */
public XAConnection getXAConnection() throws SQLException {
 return getXAConnection(getUser(), getPassword());
}
origin: org.postgresql/postgresql

@Override
public void commit(Xid xid, boolean onePhase) throws XAException {
 if (LOGGER.isLoggable(Level.FINEST)) {
  debug("committing xid = " + xid + (onePhase ? " (one phase) " : " (two phase)"));
 }
 if (xid == null) {
  throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL);
 }
 if (onePhase) {
  commitOnePhase(xid);
 } else {
  commitPrepared(xid);
 }
}
origin: org.postgresql/postgresql

 public XADataSource createXADataSource(Properties props) throws SQLException {
  props = new SingleUseProperties(props);
  PGXADataSource dataSource = new PGXADataSource();
  configureBaseDataSource(dataSource, props);
  return dataSource;
 }
}
origin: org.postgresql/postgresql

PGXAException(String message, Throwable cause, int errorCode) {
 super(message);
 initCause(cause);
 this.errorCode = errorCode;
}
origin: org.postgresql/postgresql

/**
 * This is for debugging purposes only.
 */
public String toString() {
 return xidToString(this);
}
origin: org.postgresql/postgresql

/**
 * Does nothing, since we don't do heuristics.
 */
@Override
public void forget(Xid xid) throws XAException {
 throw new PGXAException(GT.tr("Heuristic commit/rollback not supported. forget xid={0}", xid),
   XAException.XAER_NOTA);
}
origin: org.postgresql/postgresql

public Object getObjectInstance(Object obj, Name name, Context nameCtx,
  Hashtable<?, ?> environment) throws Exception {
 Reference ref = (Reference) obj;
 String className = ref.getClassName();
 if (className.equals("org.postgresql.xa.PGXADataSource")) {
  return loadXADataSource(ref);
 } else {
  return null;
 }
}
origin: org.postgresql/postgresql

private int mapSQLStateToXAErrorCode(SQLException sqlException) {
 if (isPostgreSQLIntegrityConstraintViolation(sqlException)) {
  return XAException.XA_RBINTEGRITY;
 }
 return XAException.XAER_RMFAIL;
}
origin: postgresql/postgresql

public void commit(Xid xid, boolean onePhase) throws XAException {
  if (logger.logDebug())
    debug("committing xid = " + xid + (onePhase ? " (one phase) " : " (two phase)"));
  if (xid == null)
    throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL);
  if (onePhase)
    commitOnePhase(xid);
  else
    commitPrepared(xid);
}
origin: postgresql/postgresql

  private Object loadXADataSource(Reference ref)
  {
    PGXADataSource ds = new PGXADataSource();
    return loadBaseDataSource(ds, ref);
  }
}
origin: apache/incubator-shardingsphere

  @SneakyThrows
  @Override
  public XAConnection wrap(final XADataSource xaDataSource, final Connection connection) {
    BaseConnection physicalConnection = (BaseConnection) connection.unwrap(Class.forName("org.postgresql.core.BaseConnection"));
    return new PGXAConnection(physicalConnection);
  }
}
origin: org.postgresql/postgresql

 PGXAException(Throwable cause, int errorCode) {
  super(errorCode);

  initCause(cause);
 }
}
origin: postgresql/postgresql

/**
 * This is for debugging purposes only
 */
public String toString()
{
  return xidToString(this);
}
origin: postgresql/postgresql

/**
 * Does nothing, since we don't do heuristics, 
 */
public void forget(Xid xid) throws XAException {
  throw new PGXAException(GT.tr("Heuristic commit/rollback not supported"), XAException.XAER_NOTA);
}
origin: org.postgresql/postgresql

/**
 * Gets a XA-enabled connection to the PostgreSQL database. The database is identified by the
 * DataSource properties serverName, databaseName, and portNumber. The user to connect as is
 * identified by the arguments user and password, which override the DataSource properties by the
 * same name.
 *
 * @return A valid database connection.
 * @throws SQLException Occurs when the database connection cannot be established.
 */
public XAConnection getXAConnection(String user, String password) throws SQLException {
 Connection con = super.getConnection(user, password);
 return new PGXAConnection((BaseConnection) con);
}
origin: postgresql/postgresql

PGXAException(String message, Throwable cause, int errorCode) {
  super(message);
  initCause(cause);
  this.errorCode = errorCode;
}
origin: postgresql/postgresql

/**
 * Gets a XA-enabled connection to the PostgreSQL database.  The database is identified by the
 * DataSource properties serverName, databaseName, and portNumber. The user to
 * connect as is identified by the arguments user and password, which override
 * the DataSource properties by the same name.
 *
 * @return A valid database connection.
 * @throws SQLException
 *     Occurs when the database connection cannot be established.
 */
public XAConnection getXAConnection(String user, String password) throws SQLException
{
  Connection con = super.getConnection(user, password);
  return new PGXAConnection((BaseConnection) con);
}
origin: postgresql/postgresql

  PGXAException(Throwable cause, int errorCode) {
    super(errorCode);

    initCause(cause);
  }
}
org.postgresql.xa

Most used classes

  • PGXADataSource
  • PGXAConnection
  • PGXADataSourceFactory
    An ObjectFactory implementation for PGXADataSource-objects.
  • PGXAException
    A convenience subclass of XAException which makes it easy to create an instance ofXAException with a
  • RecoveredXid
  • AbstractJdbc3XADataSource
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now