You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Yaocl <ch...@gmail.com> on 2012/05/16 12:00:24 UTC
@DataSourceDefinition and persistence.xml
Hi
After use @DataSourceDefinition to define a datasource I can inject it
to @Resource Datasource ds field.
But I can't use the it in persistence.xml .
And I found this in logs
INFO: Adjusting PersistenceUnit foo <jta-data-source> to Resource ID
'My DataSource' from 'java:app/jdbc/fooDatabase'
2012-5-16 17:46:31 org.apache.openejb.config.AutoConfig setNonJtaDataSource
INFO: Adjusting PersistenceUnit foo <non-jta-data-source> to Resource
ID 'My Unmanaged DataSource' from 'java:app/jdbc/fooDatabase'
My Definition
@DataSourceDefinition(name = "java:app/jdbc/ribaoDatabase",//
className = "org.postgresql.ds.PGPoolingDataSource", //
portNumber = 5432, serverName = "127.0.0.1", //
databaseName = "testdb", //
user = "postgres", //
password = "postgres")
Is the @DataSourceDefinition support finished?
--
YaoCl
Re: @DataSourceDefinition and persistence.xml
Posted by Romain Manni-Bucau <rm...@gmail.com>.
yep this should work
- Romain
2012/5/16 Yaocl <ch...@gmail.com>
> Thank you
>
> I will try trunk version later.
> Maybe define DataSource in resources.xml
>
> --
> YaoCL
>
Re: @DataSourceDefinition and persistence.xml
Posted by Yaocl <ch...@gmail.com>.
Thank you
I will try trunk version later.
Maybe define DataSource in resources.xml
--
YaoCL
Re: @DataSourceDefinition and persistence.xml
Posted by Romain Manni-Bucau <rm...@gmail.com>.
ok so it shouldn't work.
we fixed it recently.
- Romain
2012/5/16 Yaocl <ch...@gmail.com>
> Hi
>
> Not the trunk.It is 1.0 release.
>
> On Wed, May 16, 2012 at 6:18 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Hi,
> >
> > which version?
> >
> > on trunk it should work but that's not well defined in the spec (jboss
> > shouldnt work for instance)
> >
> > - Romain
> >
> >
> > 2012/5/16 Yaocl <ch...@gmail.com>
> >
> >> Hi
> >>
> >> After use @DataSourceDefinition to define a datasource I can inject it
> >> to @Resource Datasource ds field.
> >> But I can't use the it in persistence.xml .
> >>
> >> And I found this in logs
> >>
> >> INFO: Adjusting PersistenceUnit foo <jta-data-source> to Resource ID
> >> 'My DataSource' from 'java:app/jdbc/fooDatabase'
> >> 2012-5-16 17:46:31 org.apache.openejb.config.AutoConfig
> setNonJtaDataSource
> >> INFO: Adjusting PersistenceUnit foo <non-jta-data-source> to Resource
> >> ID 'My Unmanaged DataSource' from 'java:app/jdbc/fooDatabase'
> >>
> >> My Definition
> >> @DataSourceDefinition(name = "java:app/jdbc/ribaoDatabase",//
> >> className = "org.postgresql.ds.PGPoolingDataSource", //
> >> portNumber = 5432, serverName = "127.0.0.1", //
> >> databaseName = "testdb", //
> >> user = "postgres", //
> >> password = "postgres")
> >>
> >> Is the @DataSourceDefinition support finished?
> >>
> >> --
> >> YaoCl
> >>
>
Re: @DataSourceDefinition and persistence.xml
Posted by Yaocl <ch...@gmail.com>.
Hi
Not the trunk.It is 1.0 release.
On Wed, May 16, 2012 at 6:18 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Hi,
>
> which version?
>
> on trunk it should work but that's not well defined in the spec (jboss
> shouldnt work for instance)
>
> - Romain
>
>
> 2012/5/16 Yaocl <ch...@gmail.com>
>
>> Hi
>>
>> After use @DataSourceDefinition to define a datasource I can inject it
>> to @Resource Datasource ds field.
>> But I can't use the it in persistence.xml .
>>
>> And I found this in logs
>>
>> INFO: Adjusting PersistenceUnit foo <jta-data-source> to Resource ID
>> 'My DataSource' from 'java:app/jdbc/fooDatabase'
>> 2012-5-16 17:46:31 org.apache.openejb.config.AutoConfig setNonJtaDataSource
>> INFO: Adjusting PersistenceUnit foo <non-jta-data-source> to Resource
>> ID 'My Unmanaged DataSource' from 'java:app/jdbc/fooDatabase'
>>
>> My Definition
>> @DataSourceDefinition(name = "java:app/jdbc/ribaoDatabase",//
>> className = "org.postgresql.ds.PGPoolingDataSource", //
>> portNumber = 5432, serverName = "127.0.0.1", //
>> databaseName = "testdb", //
>> user = "postgres", //
>> password = "postgres")
>>
>> Is the @DataSourceDefinition support finished?
>>
>> --
>> YaoCl
>>
Re: @DataSourceDefinition and persistence.xml
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,
which version?
on trunk it should work but that's not well defined in the spec (jboss
shouldnt work for instance)
- Romain
2012/5/16 Yaocl <ch...@gmail.com>
> Hi
>
> After use @DataSourceDefinition to define a datasource I can inject it
> to @Resource Datasource ds field.
> But I can't use the it in persistence.xml .
>
> And I found this in logs
>
> INFO: Adjusting PersistenceUnit foo <jta-data-source> to Resource ID
> 'My DataSource' from 'java:app/jdbc/fooDatabase'
> 2012-5-16 17:46:31 org.apache.openejb.config.AutoConfig setNonJtaDataSource
> INFO: Adjusting PersistenceUnit foo <non-jta-data-source> to Resource
> ID 'My Unmanaged DataSource' from 'java:app/jdbc/fooDatabase'
>
> My Definition
> @DataSourceDefinition(name = "java:app/jdbc/ribaoDatabase",//
> className = "org.postgresql.ds.PGPoolingDataSource", //
> portNumber = 5432, serverName = "127.0.0.1", //
> databaseName = "testdb", //
> user = "postgres", //
> password = "postgres")
>
> Is the @DataSourceDefinition support finished?
>
> --
> YaoCl
>