Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Connection pool with 1 shared connection for all reading a writing

Hi Martin

You can consider using a third-party connection pool like Universal Connection Pool (UCP).

The following link should be useful:

http://onpersistence.blogspot.com/2008/04/eclipselink-and-datasources.html

Let me know if the above works for you. You may need to tweak the code a bit.

On 4/12/2011 1:34 PM, Janda Martin wrote:
Please can you help me. 

Due to bugs in prehistoric third party JDBC driver we are forced to access database through only one shared connection for reading and writing.

Environment:
Java SE 6u24, Eclipselink 2.1.2, platform MS Access


I tried to limit connection pool that solved the problem with shared connection for reading/writing

            <property name="eclipselink.jdbc.connections.initial" value="0"/>
            <property name="eclipselink.jdbc.connections.min" value="0"/>
            <property name="eclipselink.jdbc.connections.max" value="1"/>
            
            <property name="eclipselink.jdbc.connection_pool.read.shared" value="true"/>
            <property name="eclipselink.jdbc.read-connections.shared" value="true"/>

There is problem when I want access DB from multiple threads. Because other waits on Connection Pool for releasing connection.

Typical scenario: 
 1st thread - works ScrollableCursor
 2nd thread - try to execute ReadAllQuery (select * from...)

ReadAllQuery is waiting for connection that is held by ScrollableCursor

I think that is possible to implement custom connection pool.


Question: is there any documentation/tutorial or code sample that shows how to implement connection pool for EclipseLink 2.1.2. Would it work for EclipseLink 2.2, newer versions?


Thank you very much for help

 Martin

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

--
Thanks and Regards
Rohit Banga
Member Technical Staff
Oracle Server Technologies

Back to the top