Skip to main content

[javaee-spec users] Re: [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans

  • From: Reza Rahman <reza_rahman@...>
  • To: users@...
  • Subject: [javaee-spec users] Re: [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans
  • Date: Fri, 06 Jan 2012 16:43:12 -0500

Not sure if you can annotate an annotation :-). You can place @DataSourceDefinition on a bean declared @Alternative though. You could of course modify XML deployment descriptors at runtime too.

On 1/6/2012 2:16 PM, Antonio Goncalves wrote:
I will file an issue but the purpose of my email was really to have @Alternative on a @DataSourceDefinition (and JMS definitions in the future). Something that sounded obvious to me (having several alternatives definitions) is not possible in CDI 1.0. Hope it will be in 1.1.

On Fri, Jan 6, 2012 at 19:37, Pete Muir <pmuir@...> wrote:
If you file an issue at http://issues.jboss.org/browse/CDITCK we can add some tests to the CDI TCK for @DataSourceDefinition.

On 6 Jan 2012, at 18:35, reza_rahman@... wrote:

> Although, if I recall correctly there was no TCK test for this...
>
> Jan 6, 2012 01:32:22 PM, jsr342-experts@... wrote:
> It's basically a bug I think -- we implemented what you are looking for in Resin. I think the Java EE platform spec is pretty clear about @DataSourceDefinition on plain managed beans, Servlets, EJB.
>
> Jan 6, 2012 03:05:45 AM, jsr342-experts@... wrote:
> Hi all,
>
> I just came accross a limitation (bug) of GlassFish : adding a @DataSourceDefinition on a CDI bean doesn't work in an embedded environment (http://www.java.net/forum/topic/glassfish/glassfish/invalid-resource-datasource-embedded-mode). I had to put it in the EJB to make it work.
>
> Why do I use  @DataSourceDefinition on a CDI bean instead of an EJB ? Because I thought I could use alternatives (i.e. defining several data sources depending on the environment). But this doesn't work in CDI 1.0 (https://issues.jboss.org/browse/CDI-53).
>
> Alternatives should work on definitions, don't you think ? In other specs, are you aware of other kind of definitions (I know that JMS 2.0 will bring similar features with @JMSConnectionFactoryDefinition and @JMSDestinationDefinition) ? If yes, we should encourage the spec leads to use similar behavior.
>
> My 2 cents
>
> --
> Antonio Goncalves
> Software architect and Java Champion
>
> Web site | Twitter | Blog | LinkedIn | Paris JUG




--
Antonio Goncalves
Software architect and Java Champion

Web site | TwitterBlog | LinkedInParis JUG

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1901 / Virus Database: 2109/4726 - Release Date: 01/06/12




[javaee-spec users] [jsr342-experts] Datasources and other resources defined on CDI beans

Antonio Goncalves 01/06/2012

[javaee-spec users] [jsr342-experts] Re: Datasources and other resources defined on CDI beans

reza_rahman@... 01/06/2012

[javaee-spec users] [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans

reza_rahman@... 01/06/2012

[javaee-spec users] Re: [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans

Pete Muir 01/06/2012

[javaee-spec users] Re: [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans

Antonio Goncalves 01/06/2012

[javaee-spec users] Re: [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans

Pete Muir 01/06/2012

[javaee-spec users] Re: [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans

Bill Shannon 01/06/2012

[javaee-spec users] Re: [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans

Antonio Goncalves 01/09/2012

[javaee-spec users] Re: [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans

reza_rahman@... 01/09/2012

[javaee-spec users] Re: [jsr342-experts] Re: Re: Datasources and other resources defined on CDI beans

Reza Rahman 01/06/2012
 
 
Close
loading
Please Confirm
Close