tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: Resource elements in openejb.xml quietly remapping to Default JDBC Database?
Date Sun, 23 Dec 2007 02:28:53 GMT
On Dec 22, 2007, at 4:54 PM, Alexander Saint Croix wrote:

> I specify two <Resource> mappings in my openejb.xml file, which look  
> like this:
>
> <Resource id="myDataSource" type="DataSource">
...
> <Resource id="myNonJtaDataSource" type="DataSource">
...
> Now, this all looks normal thus far, but when I boot Tomcat, my
> openejb logs tell me the following:
>
> ...
> 2007-12-22 18:37:20,636 - INFO  - Configuring Service(id=myDataSource,
> type=Resource, provider-id=Default JDBC Database)
> 2007-12-22 18:37:20,638 - INFO  - Configuring
> Service(id=myNonJtaDataSource, type=Resource, provider-id=Default JDBC
> Database)
> ...
>
> This seems to indicate that the two resources are getting
> automatically pointed at the Default JDBC Database.

Correct.  This is the desired behavior.  You're essentially creating a  
new DataSource definition using the default values of "Default JDBC  
Database" + the values you've specified.

It should have worked and I've figured out why it didn't.  When I  
added support for the JtaManaged flag, I forgot to update the service- 
jar.xml we use in Tomcat.  It was still using the old DataSource  
factories and you weren't getting the non-jta-datasource you needed.   
You inadvertently fixed the issue by setting your Resource id to  
"Default Unmanaged JDBC Database" (setting provider="Default Unmanaged  
JDBC Database" would have also worked and allowed you to use any id  
you like).

So fixed two things.  One, I fixed the tomcat servce-jar.xml so the  
configuration you described above should work.  Two, I added warnings  
on any properties that don't exist -- this should have been there all  
along and will prevent any future situations where someone is using a  
configuration flag that is actually doing nothing.

Thank you *very* much for reporting the issue.


-David


Mime
View raw message