[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [eclipselink-dev] EntityManager usage of ClientSession
|
1) Currently the lifecycle of the
ClientSession matches that of the EntityManager as all EntityManagers are
extended from the Provider's point of view. Because they are extended the
UOW, EntityManager and ClientSession all have the same life termination
point.
2) I
agree with Andrie and James.
3)
Andrei had a good idea.
--Gordon
Developers,
On the TopLink forum
there is a customer trying to use proxy authentication. Our documentation
and a similar thread on the JDeveloper
forum show the usage of proxy authentication using a SessionEventListener
and a custom call to Server.acquireClientSession(db-login). Using this within
JPA is proving challenging. The SessionEventListener can be easily introduced
using a persistence unit property but addressing the proxy credentials is more
challenging:
Login login = (Login)serverSession.getLogin().clone();
login.setProperty("proxytype", Integer.toString(OracleConnection.PROXYTYPE_USER_NAME));
login.setProperty(OracleConnection.PROXY_USER_NAME, "hr");
ConnectionPolicy connectionPolicy = new ConnectionPolicy(login);
// for vpd support connectionPolicy.setShouldUseExclusiveConnection(true);
clientSession = serverSession.acquireClientSession(connectionPolicy);
I took a quick
look through our implementation of EntityManager and we have one case where we
acquire a client session in the process of acquiring a UnitOfWork but in most
cases we simply acquire the UnitOfWork from the server session. I know this
internally results in a client session but it does feel weird. I would have
expected us to acquire a client session and hold it in the EntityManager
(possibly during construction) and then acquire repeatable-read UnitOfWork or
non-synchonized UnitOfWork as needed form the client session. This would allow
the isolated client session, when used, to have a life-cycle equivalent to
that of the EntityManager.
I guess I have a
few questions:
1. Should our
EntityManagerImpl wrap a client-session instead of a server session to better
handle the isolated client session's cache lifecycle matching that of the
EntityManager? If we need a server session we can always get it through
getParent()
2. How can we
address proxy authentication through JPA? We need to change how we create the
client session within the EntityManagerImpl and thus the lifecycle of the
client session is important to this discussion. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=219434
3. Does anyone
have an idea of how I could work-around our current implementation limitations
to make proxy authentication work through our current JPA implementation in
EclipseLink?
Cheers,
Doug
Doug Clarke
Director of
Product Management, Oracle TopLink
Oracle Server
Technologies
45 O'Connor, Suite 4000 | Ottawa, ON K1P
1A4 Canada
+1
613 288 4617