aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Holly Cummins (JIRA)" <>
Subject [jira] Created: (ARIES-601) Add service ranking to re-registered XA data source
Date Tue, 08 Mar 2011 11:22:59 GMT
Add service ranking to re-registered XA data source

                 Key: ARIES-601
             Project: Aries
          Issue Type: Improvement
            Reporter: Holly Cummins
            Priority: Minor

 In the 
blog sample we use the service property to uniquely identify the datasource
services. However, in the persistence.xml, we only use the jndi service name as a filter property,


instead of writing:


It seems a shame to bother to specify the property but then not take advantage
of the shorter JNDI name, but there's a good 
reason we don't - it doesn't work. 

The datasource blueprint.xml declares two services, for DataSource and XADataSource, and then
Aries helpfully auto-creates a third service, which makes an enriched wrapper of the EmbeddedXADataSource
bean for lookups of the DataSource interface.

Unfortunately, once this has been done we have two services with the same JNDI service name.
Anything which uses the JNDI name 
osgi:service/jdbc/blogdb, expecting a DataSource, gets a classcast exception, because an XADataSource
is returned. 

A neat solution is to add a service ranking (which adds, say, 1000 to the original service
ranking) to the re-registered DataSource so that it is returned in preference to the XADataSource
when a short-form JNDI lookup is done.

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message