tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kalyan <kalyanfrem...@gmail.com>
Subject HikariCp to set JtaManaged
Date Fri, 28 Jun 2019 21:18:19 GMT
Hello,
Does Hikari supports JTA ?

In the openejb how can i set to JtaManaged = true for the HikariCP? 

p.put("DS1",
"new://Resource?type=javax.sql.DataSource&class-name=org.superbiz.ConnectionPoolFactory&factory-name=create");
        p.put("DS1.JdbcDriver", "oracle.jdbc.OracleDriver");
        p.put("DS1.JdbcUrl", "jdbc:oracle:thin:@xxxxxx1521/rwdb");
        p.put("DS1.UserName", "admin");
        p.put("DS1.Password", "xxxxxx");
        p.put("DS1.LogSql", "true");
        p.put("DS1.JtaManaged", "true");

Even though i set to true. Looks like its ignored. 

WARN - unused property 'JtaManaged' for resource 'DS1'



public class ConnectionPoolFactory {
    private Properties properties;
    public Properties getProperties() {
        return properties;
    }
    public void setProperties(final Properties properties) {
        this.properties = properties;
    }

    public Object create() {
            HikariConfig hikariConfig = new HikariConfig();
            int connIdleTimeInMinutes = 10;
            int connWaitTimeInMilliSec = 1000;
            // Initialize connection pool
           
hikariConfig.setPoolName(properties.getProperty("HikariDS.PoolName"));
            hikariConfig.setJdbcUrl(properties.getProperty("JdbcUrl"));
            hikariConfig.setAutoCommit(false);
            hikariConfig.setUsername(properties.getProperty("Username"));
            hikariConfig.setPassword(properties.getProperty("Password"));
           
hikariConfig.setMaximumPoolSize(Integer.parseInt(properties.getProperty("MaximumPoolSize",
"20")));
           
hikariConfig.setMinimumIdle(Integer.parseInt(properties.getProperty("MinimumIdle",
"20")));
            hikariConfig.setIdleTimeout(connIdleTimeInMinutes * 60 * 1000);
            hikariConfig.setConnectionTimeout(connWaitTimeInMilliSec);
            HikariDataSource resource = new HikariDataSource(hikariConfig);
            return resource;
    }
}


Due to this the transactions are not performing. As it suppose to. 
Please help me with this. 

thanks
Kalyan



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html

Mime
View raw message