Search in sources :

Example 1 with OracleXAResource

use of com.sun.enterprise.transaction.jts.recovery.OracleXAResource in project Payara by payara.

the class JavaEETransactionManagerJTSDelegate method initTransactionProperties.

public void initTransactionProperties() {
    if (serviceLocator != null) {
        txnService = serviceLocator.getService(TransactionService.class, ServerEnvironment.DEFAULT_INSTANCE_NAME);
        if (txnService != null) {
            String value = txnService.getPropertyValue("use-last-agent-optimization");
            if (value != null && "false".equals(value)) {
                setUseLAO(false);
                if (_logger.isLoggable(Level.FINE))
                    _logger.log(Level.FINE, "TM: LAO is disabled");
            }
            value = txnService.getPropertyValue("oracle-xa-recovery-workaround");
            if (value == null || "true".equals(value)) {
                xaresourcewrappers.put("oracle.jdbc.xa.client.OracleXADataSource", new OracleXAResource());
            }
            if (Boolean.parseBoolean(txnService.getPropertyValue("sybase-xa-recovery-workaround"))) {
                xaresourcewrappers.put("com.sybase.jdbc2.jdbc.SybXADataSource", new SybaseXAResource());
            }
            if (Boolean.parseBoolean(txnService.getAutomaticRecovery())) {
                // If recovery on server startup is set, initialize other properties as well
                Properties props = TransactionServiceProperties.getJTSProperties(serviceLocator, false);
                DefaultTransactionService.setServerName(props);
                if (Boolean.parseBoolean(txnService.getPropertyValue("delegated-recovery"))) {
                    _logger.warning("delegated-recovery is no longer supported!!");
                }
            }
        }
    }
}
Also used : DefaultTransactionService(com.sun.jts.CosTransactions.DefaultTransactionService) TransactionService(com.sun.enterprise.transaction.config.TransactionService) SybaseXAResource(com.sun.enterprise.transaction.jts.recovery.SybaseXAResource) OracleXAResource(com.sun.enterprise.transaction.jts.recovery.OracleXAResource) TransactionServiceProperties(com.sun.jts.jta.TransactionServiceProperties) Properties(java.util.Properties)

Aggregations

TransactionService (com.sun.enterprise.transaction.config.TransactionService)1 OracleXAResource (com.sun.enterprise.transaction.jts.recovery.OracleXAResource)1 SybaseXAResource (com.sun.enterprise.transaction.jts.recovery.SybaseXAResource)1 DefaultTransactionService (com.sun.jts.CosTransactions.DefaultTransactionService)1 TransactionServiceProperties (com.sun.jts.jta.TransactionServiceProperties)1 Properties (java.util.Properties)1