This content has been marked as final.
Show 3 replies
-
1. Re: Beta: Can't use non-default datasource
leonell Jun 26, 2005 11:58 AM (in response to shane.bryzak)"sbryzak2" wrote:
my-app.ear |-my-app.par |-my-app.ejb3 |-my-app.war |-application.xml
I mean that application.xml must be in META-INF folder.# jar tvf tutorial.ear META-INF/ META-INF/application.xml tutorial.ejb3 em1.par em2.par
Leonell -
2. Re: Beta: Can't use non-default datasource
leonell Jun 26, 2005 3:18 PM (in response to shane.bryzak)Hello,
I tested it and new EAR package worked (with non-default datasource).
You need move application.xml to META-INF and modify your session bean to map Entity manager to persist.xml in par package.
See packaging example in tutorial.
Also note: you right, in ejb3 archives (and Beta) is used default dataset regardless of META-INF/hibernate.properties setting.
Leonell -
3. Re: Beta: Can't use non-default datasource
shane.bryzak Jun 26, 2005 4:59 PM (in response to shane.bryzak)"leonell" wrote:
I tested it and new EAR package worked (with non-default datasource).
You need move application.xml to META-INF and modify your session bean to map Entity manager to persist.xml in par package.
See packaging example in tutorial.
Also note: you right, in ejb3 archives (and Beta) is used default dataset regardless of META-INF/hibernate.properties setting.
My application.xml is actually in the meta-inf directory (sorry about the mixup there). I think the problem is my session bean, as you pointed out. I found the new @PersistenceContext annotations in the tutorial source code (though no mention of it in tutorial/packaging/packaging.html, maybe there should be something here? :) and will try them today (I imagine they will solve my problem). Thanks for pointing me in the right direction.
Shane