tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgjava <sgj...@gmail.com>
Subject Transaction without JPA
Date Sat, 25 May 2019 14:58:18 GMT
Can TomEE handle a JDBC transactions without using @PersistenceContext? I'm
using my own DAO layer and would like to add container managed transactions.
Even if I have to resort bean managed I should be able to  use an
interceptor t replace the boiler plate code. My DataSource looks like this:

        final Properties p = new Properties();
        // DataSource
        p.put("dataSource", "new://Resource?type=DataSource");
        p.put("dataSource.JdbcDriver",
properties.getProperty("db.xa.driver"));
        p.put("dataSource.JdbcUrl", properties.getProperty("db.xa.url"));
        p.put("dataSource.userName", properties.getProperty("db.xa.user"));
        p.put("dataSource.password",
properties.getProperty("db.xa.password"));
        p.put("dataSource.jtaManaged", true);
        p.put("dataSource.maxActive", 10);
        p.put("dataSource.maxIdle", 5);
        // Transaction manager
        p.put("transactionManager",
"new://TransactionManager?type=TransactionManager");
        ejbContainer = EJBContainer.createEJBContainer(p);
        final Context context = ejbContainer.getContext();




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

Mime
View raw message