We'll need to wire it into a ManagedConnection. Not sure how to do that off
the top of my head, but I'm working in that area on Monday, so I'll help
you out.

Jon

On Fri, 28 Jun 2019, 22:18 Kalyan, <kalyanfrem...@gmail.com> wrote:

> 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
>

Reply via email to