jsr342-experts@javaee-spec.java.net

[jsr342-experts] Re: Clarification on Default resources

From: Kevin Sutter <sutter_at_us.ibm.com>
Date: Thu, 6 Jun 2013 15:34:15 -0500

Hi Jason,
>
> Do these both point to the same underly database though, and thus
> share the same underlying data, or do you partition based on name?
> If so I don't think there is a problem. If they are isolated thats
> going to create a portability challenge.
>

The WebSphere default jndi name that is generated is based on the field
name (myDS and myDStoo). So, I agree that this will introduce a
portability challenge... :-)

Still looking for confirmation from Werner and David that this was their
interpretation as well. Maybe I'm the only one that missed this, but from
the sounds of Werner's and David's earlier replies on this topic, I got
the impression that the empty @Resource declaration would allow for
product-specific default processing... I appreciate the input!

----------------------------------------------------------------------------------------------------------------------------------------------------------------
Kevin Sutter, Java EE and Java Persistence API (JPA) architect
mail: sutter_at_us.ibm.com, Kevin Sutter/Rochester/IBM
http://webspherepersistence.blogspot.com/
phone: tl-553-3620 (office), 507-253-3620 (office)
http://openjpa.apache.org/
 

Jason Greene <jason.greene_at_redhat.com> wrote on 06/06/2013 02:57:14 PM:

> From: Jason Greene <jason.greene_at_redhat.com>
> To: jsr342-experts_at_javaee-spec.java.net,
> Date: 06/06/2013 02:57 PM
> Subject: [jsr342-experts] Re: Clarification on Default resources
>
>
> On Jun 6, 2013, at 10:56 AM, Kevin Sutter <sutter_at_us.ibm.com> wrote:
>
> > Hi Linda,
> >
> > > I'm not sure whether your interpretation is in agreement with what
> > > I've written. Can you confirm?
> >
> > Unfortunately, no... I won't speak for David's situation with
> OpenEJB and TomEE, but from a WebSphere perspective, this
> interpretation puts us in a pickle... WebSphere provides default
> bindings based on the name of the resource. So, something like this
> would map to two separate datasources due to the default bindings
> that WebSphere utilized prior to Java EE 7:
> >
> > @Resource
> > DataSource myDS;
> > @Resource
> > DataSource myDStoo;
> >
>
> Do these both point to the same underly database though, and thus
> share the same underlying data, or do you partition based on name?
> If so I don't think there is a problem. If they are isolated thats
> going to create a portability challenge.
>
> > With your stated interpretation, both of these datasources (myDS
> and myDStoo) would map to the same datasource that is defined at
> "java:comp/DefaultDataSource", correct?
>
>
> --
> Jason T. Greene
> WildFly Lead / JBoss EAP Platform Architect
> JBoss, a division of Red Hat
>