Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 persistent units with parameter generatedll=true --> All entities are generated in the 2 databases [SPR-12809] #17406

Closed
spring-issuemaster opened this issue Mar 12, 2015 · 5 comments
Assignees

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Mar 12, 2015

christophe larcher opened SPR-12809 and commented

Hello,

I just configure 2 persistent Unit in my project; each persistent unit (attached to one particular datasource) manage different entities : everything works fine till I I set the generateDll parameter to true ( when I want to create the tables from the jpa entities)
When I run the application : it seems that it creates twice all the tables from the entities in the 2 databases.( instead of creating tables from entities managed by persistentUnit1 in database1, and also all tables .....in database2) : I cant figure out why it occurs.
When I run my application with the parameter "generateDll=false" : I have no problem with the demarcation of the 2 persistent Unit.
I attach my configuration files.
I have ever tried to use 2 persistent.xml files (one for each persistent unit) : but the problem still occurs.
Best regards.
Christophe


Affects: 4.1.1

Attachments:

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Mar 13, 2015

Stéphane Nicoll commented

This sounds like a quite complicated setup. Is there any chance you can provide a sample that reproduces the problem? Thanks.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Mar 16, 2015

christophe larcher commented

Hi Stephane,
I just packaged a simple version of my application. (ndatabase.zip)
You just have to unzip, package and deploy on tomcat....Hope it'll help..
Best regards.
Christophe

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Mar 17, 2015

Stéphane Nicoll commented

Thanks but your project does not compile for me, there are a lot of unnecessary stuff. "mvn package" in ndatabaseCommons does not work either.

We do have a test that seems to correspond to your setup. See this configuration and this persistence unit configuration

Maybe you could enable logs of hibernate to see what is going on? Looking at the code, I don't think there is an issue on our side. Please provide a working sample that fails if you believe otherwise. Thanks!

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Mar 17, 2015

christophe larcher commented

Hi Stéphane,

I just check the config you sent me : I have noticed the use of the tag "exclude-unlisted-classes" in your persistent.xml for each persistent unit.
I just modified my configuration with this tag and now it seems that it works !
Thank you very much Stéphane.
We can close this ticket
Best regards

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Mar 17, 2015

Stéphane Nicoll commented

I suspected that. Thanks for checking and letting us know! Bonne journée.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.