Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » setTableQualifier(schema) without transaction
setTableQualifier(schema) without transaction [message #900899] Wed, 08 August 2012 21:37 Go to next message
Ed Hughes is currently offline Ed HughesFriend
Messages: 1
Registered: August 2012
Junior Member
For one of our persistence units, we have a requirement to switch the schema prefix based on context at various times during a session.

We found this call:
session.getLogin().setTableQualifier(schema);

...however the problem is to get the session, you need to be in a transaction. At this time, most of our services are not @Transactional.

Any thoughts on alternative ways to switch the schema prefix would be appreciated.

Thanks!
-Ed

EL/JPA: 2.3.0, Database: Oracle 11g
Re: setTableQualifier(schema) without transaction [message #905044 is a reply to message #900899] Wed, 29 August 2012 15:31 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You cannot switch the schema at runtime.

You need either a different persistence unit, or EntityManagerFactory per schema, or change the schema based on the user and pass the user when creating the EntityManager.


James : Wiki : Book : Blog : Twitter
Previous Topic:Anyone using EclipseLink-EIS
Next Topic:Copygroup
Goto Forum:
  


Current Time: Thu Nov 27 04:36:52 GMT 2014

Powered by FUDForum. Page generated in 0.02011 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software