Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] How to force using proxyed Login inselectsoutside Transaction

To verify the user:
(String)em.createNativeQuery("SELECT SYS_CONTEXT ('USERENV', 'CURRENT_SCHEMA') FROM DUAL").getSingleResult();

If the user is not the one you expect please post the code that creates the EntityManager and the log with FINEST log level.

----- Original Message ----- From: "sam8680" <deirdre.kong@xxxxxxxxxx>
To: <eclipselink-users@xxxxxxxxxxx>
Sent: Thursday, December 10, 2009 5:46 PM
Subject: Re: [eclipselink-users] How to force using proxyed Login inselectsoutside Transaction



Hello,

I am having the same problem; when I do a persist (insert), the connection
is not proxy.

I add emProperties.put("eclipselink.jdbc.exclusive-connection.mode",
"Always"); but the connection is still not proxy.

Right now, I am just running my application outside a container (just
running in Eclipse).

How can I make it so that the connection is proxy?

Thanks


Andrei Ilitchev wrote:

Add emProperties.put("eclipselink.jdbc.exclusive-connection.mode",
"Always");
----- Original Message ----- From: <martin.berner@xxxxxxxxxxxx>
To: <eclipselink-users@xxxxxxxxxxx>
Sent: Tuesday, June 09, 2009 9:59 AM
Subject: [eclipselink-users] How to force using proxyed Login in
selectsoutside Transaction


Hello,
We are using Eclipselink (1.0.1) bundled with Glassfish V3 prelude with
JTA
pooled connection on Glassfish connecting on a Oracle 10.2 Database.

Some of the Applicationusers are having a OracleUser and so I want to
connect as these. I managed that by adding proxy-properties to the
Entitymanager in a centralized Datamanager:

    private EntityManager getPersonalEntityManager(String username) {
        Map emProperties = new HashMap();
        emProperties.put("eclipselink.oracle.proxy-type",
oracle.jdbc.OracleConnection.PROXYTYPE_USER_NAME);
        emProperties.put(oracle.jdbc.OracleConnection.PROXY_USER_NAME,
username);
        EntityManager em =
getEntityManagerFactory().createEntityManager(emProperties);
        return em;
    }

When I do a Select, the connection is not proxied. I read in the ELUG that
only selects and updates in a Transaction are proxied. How can I force
proxying the connection even on simple selects? Transactions are managed
from Glassfish..

Best regards Berner Martin

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



--
View this message in context: http://old.nabble.com/How-to-force-using-proxyed-Login-in-selects-outside-Transaction-tp23943514p26735863.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users




Back to the top