Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Disabling EclipseLink Connection Pooling

Zarar,
    May help - try setting the new connector on both the read and write connection pool, as it looks like the failure is due to DefaultConnector deferring to using RESOURCE_LOCAL jdbc properties for a direct connection.

            JNDIConnector readConnector = (JNDIConnector)((DatabaseLogin)((ServerSession)session).getReadConnectionPool().getLogin()).getConnector();
or
            (JNDIConnector)((DatabaseLogin)((ServerSession)session).getReadConnectionPool().getLogin()).setConnector(new JNDIConnector(dataSource));

    thank you
    /Michael

On 2010-12-07 17:33, Zarar Siddiqi wrote:
Using 2.1.1. Trying to completely disable connection pooling by EclipseLink as it's handled externally, but I randomly get the following exception where it tries to get a connection on its own but fails.

Exception Description: Unable to acquire a connection from driver [null], user [null] and URL [null].  Verify that you have set the expected driver class and URL.  Check your login, persistence.xml or sessions.xml resource.  The jdbc.driver property should be set to a class that is compatible with your database platform
at org.eclipse.persistence.exceptions.DatabaseException.unableToAcquireConnectionFromDriverException(DatabaseException.java:376)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:91)


In my session customizer I have:

        session.getLogin().setConnector(new JNDIConnector(dataSource)); //  I get dataSource from Spring
        session.getLogin().useExternalConnectionPooling();

My persistence.xml looks like:

             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             version="2.0">
    <persistence-unit name="db">
     
        <properties>
            <property name="eclipselink.target-database" value="ca.utoronto.sis.sws.db.ExtendedDB2MainframePlatform"/>
            <property name="eclipselink.logging.level" value="FINE"/>
            <property name="eclipselink.logging.logger" value="SLF4JSessionLog"/>
            <property name="eclipselink.session.customizer" value="EclipseLinkSessionCustomizer"/>
        </properties>
</persistence-unit>
</persistence>


Any idea why it's trying to go and do this on its own when I tell it not to?

Thanks,

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


Back to the top