Codota Logo
AtomikosDataSourceBean.setTestQuery
Code IndexAdd Codota to your IDE (free)

How to use
setTestQuery
method
in
com.atomikos.jdbc.AtomikosDataSourceBean

Best Java code snippets using com.atomikos.jdbc.AtomikosDataSourceBean.setTestQuery (Showing top 4 results out of 315)

  • Common ways to obtain AtomikosDataSourceBean
private void myMethod () {
AtomikosDataSourceBean a =
  • Codota Iconnew AtomikosDataSourceBean()
  • Smart code suggestions by Codota
}
origin: hs-web/hsweb-framework

atomikosDataSourceBean.setMaintenanceInterval(getMaintenanceInterval());
atomikosDataSourceBean.setReapTimeout(getReapTimeout());
atomikosDataSourceBean.setTestQuery(getTestQuery());
atomikosDataSourceBean.setXaProperties(getXaProperties());
atomikosDataSourceBean.setMaxLifetime(getMaxLifetime());
origin: OpenNMS/opennms

public AtomikosDataSourceFactory() {
  super.setUniqueResourceName("opennms");
  super.setXaDataSource(XADataSourceFactory.getInstance());
  super.setPoolSize(30);
  // Automatically rollback the connection on borrow to avoid a problem where
  // Atomikos will reuse database connections that contain aborted transactions, 
  // mark the connections as "erroneous", and recycle the connections. We want to
  // avoid database connection recycling to avoid lockups in PostgreSQL that occur
  // when creating new connections. This occurs on PostgreSQL 8.4 but may be fixed
  // in later versions.
  //
  // These aborted transactions shouldn't happen and are probably caused by errors 
  // in JDBC code. Atomikos may also only exhibit this behavior when running without 
  // a transaction manager (as is the case in the current OpenNMS code with 
  // Hibernate 3.6).
  //
  super.setTestQuery("ROLLBACK;SELECT 1;");
  /*
  // Disable pool maintenance (reaping and shrinking) by setting the interval
  // to the highest value possible. We want the connections to PostgreSQL to 
  // remain open forever without being recycled.
  super.setMaintenanceInterval(Integer.MAX_VALUE / 1000);
  */
}
origin: org.hswebframework.web/hsweb-datasource-jta

atomikosDataSourceBean.setMaintenanceInterval(getMaintenanceInterval());
atomikosDataSourceBean.setReapTimeout(getReapTimeout());
atomikosDataSourceBean.setTestQuery(getTestQuery());
atomikosDataSourceBean.setXaProperties(getXaProperties());
atomikosDataSourceBean.setMaxLifetime(getMaxLifetime());
origin: org.atteo.moonshine/atomikos

@Override
public DataSource wrap(String name, XADataSource xaDataSource, PoolOptions poolOptions, String testQuery) {
  AtomikosDataSourceBean wrapped = new AtomikosDataSourceBean();
  wrapped.setXaDataSource(xaDataSource);
  wrapped.setUniqueResourceName(name);
  if (poolOptions == null) {
    poolOptions = new PoolOptions();
  }
  if (poolOptions.getMaxLifeTime() != null && poolOptions.getMaxLifeTime() != 0) {
    wrapped.setMaxLifetime(poolOptions.getMaxLifeTime());
  } else {
    // test query is only needed when we don't know how long Atomikos can keep connections in the pool
    wrapped.setTestQuery(testQuery);
  }
  if (poolOptions.getMinPoolSize() != null) {
    wrapped.setMinPoolSize(poolOptions.getMinPoolSize());
  }
  if (poolOptions.getMaxPoolSize() != null) {
    wrapped.setMaxPoolSize(poolOptions.getMaxPoolSize());
  }
  if (poolOptions.getMaxIdleTime() != null) {
    wrapped.setMaxIdleTime(poolOptions.getMaxIdleTime());
  }
  if (poolOptions.getReapTimeout() != null) {
    wrapped.setReapTimeout(poolOptions.getReapTimeout());
  }
  return wrapped;
}
com.atomikos.jdbcAtomikosDataSourceBeansetTestQuery

Popular methods of AtomikosDataSourceBean

  • setUniqueResourceName
  • <init>
  • setXaDataSource
    Sets the XADataSource directly - instead of providing the xaDataSourceClassName and xaProperties.
  • setMaxIdleTime
  • setMaxPoolSize
  • setMinPoolSize
  • setXaDataSourceClassName
    Sets the fully qualified underlying XADataSource class name. Required, unless you call setXaDataSour
  • setXaProperties
    Sets the properties (name,value pairs) used to configure the XADataSource. Required, unless you call
  • setReapTimeout
  • setBorrowConnectionTimeout
  • setMaintenanceInterval
  • setMaxLifetime
  • setMaintenanceInterval,
  • setMaxLifetime,
  • close,
  • getBorrowConnectionTimeout,
  • getLogWriter,
  • getLoginTimeout,
  • getMaintenanceInterval,
  • getMaxIdleTime,
  • getMaxLifetime

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • setContentView (Activity)
  • Path (java.nio.file)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
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