…Many thanks for the information.
I use the reference implementation from
jBoss as persistence provider.
A seam application runs on this Application Server. It’s a CRUD Application and users have the option to search for data in the database schema “xy”.
Now I would like to implement an extended search → user can also search for archived data on schema “xyHistory”. This is done at runtime.
The results are two Lists. List A contains the data from schema “xy” and List B contains the data from “xyHistory”.
In JDBC I would open two database connections….
Unfortunately I’m not as well familiar with JPA.
You could use two different persistence units and use XML for both or one to change the schema.
Can I switch to the other schema with persistence units at runtime?
It’s not enough to use a second entity manager?
There is a default schema in the orm.xml, potentially you could use the same annotation and just give a mostly empty orm.xml with a different default schema.
Sorry, I don’t understand this. At the moment there isn’t a orm.xml in my Project.
An example code would be very helpful.