tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: declare datasource with annotation.
Date Tue, 03 Sep 2013 08:22:55 GMT
Transactional always exists (due to its default value) and override
JtaManaged IIRC. The spec doesnt allow properties like we do (it is not
forbidden but intended for datasource properties originally, not pool
properties like we support)
Le 3 sept. 2013 10:16, "mauro2java2011" <mauro2java2011@gmail.com> a écrit :

> Finally question:
>
> from your link i get the following class:
>
> package org.superbiz.dsdef;
>
> import javax.annotation.Resource;
> import javax.annotation.sql.DataSourceDefinition;
> import javax.inject.Named;
> import javax.sql.DataSource;
>
> @DataSourceDefinition(transactional = true,
>                       url = "jdbc:h2:mem:persister",
>                       className = "org.h2.jdbcx.JdbcDataSource",
>                       user = "sa",
>                       password = "",
>                       name = "java:app/jdbc/persister",
>                       initialPoolSize = 1,
>                       maxPoolSize = 3
> )
> @Named
> public class Persister {
>
>     @Resource(lookup = "java:app/jdbc/persister")
>     private DataSource ds;
>
>     public DataSource getDs() {
>         return ds;
>     }
> }
>
> you write that into tomee it is supported  the Resource attributes like
> JtaManaged
>
> ........................................................
> We support Resource attributes like JtaManaged (but use transactional for
> this one) using properties = {"key=value","otherkey=othervalue"} but thats
> not standard
> ...............................................
>
> So if i substitute the transactional = true,
> with JtaManaged = true ,
> it work equally?????
>
> But into tomee it work the attribute transactional= true or i have to use
> JtaManaged= true ???? it is equally ?
>
>
>
> @DataSourceDefinition(transactional = true,
>                       url = "jdbc:h2:mem:persister",
>                       className = "org.h2.jdbcx.JdbcDataSource",
>                       user = "sa",
>                       password = "",
>                       name = "java:app/jdbc/persister",
>                       initialPoolSize = 1,
>                       maxPoolSize = 3
> )
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/declare-datasource-with-annotation-tp4664952p4664965.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message