Transaction without JPA

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Transaction without JPA

sgjava
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
Reply | Threaded
Open this post in threaded view
|

Re: Transaction without JPA

sgjava
Reply | Threaded
Open this post in threaded view
|

Re: Transaction without JPA

Cesar Hernandez
Hi Steven,
Thanks for sharing it with the list!

I was starting to see how to incorporate an example on
https://github.com/apache/tomee/tree/master/examples but I see Denotator is
not Apache license.
If at some point this change, let us know so we can add some cool examples.


El lun., 3 jun. 2019 a las 18:55, sgjava (<[hidden email]>) escribió:

> I figured it out. The source is on  Github
> <https://github.com/sgjava/detonator/tree/master/tomee>  .
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


--
Atentamente:
César Hernández.
Reply | Threaded
Open this post in threaded view
|

Re: Transaction without JPA

sgjava