Hi Chuck,

I have changed the code and am using ERXJDBCConnectionBroker to test the 
database connectivity and it's serving the purpose very well.

Thanks,

Farrukh

Sent from my iPad

On 28-Oct-2010, at 8:01 PM, Chuck Hill <[email protected]> wrote:

> I wrote it to debug a failure to connect so this was never a concern - the 
> JVM exited right after this.  It was NOT intended to be used how you are 
> using it.  It is intended to debug configuration issues.  
> 
> Closing this connection is non-trivial.
> 
> For what I think this is doing, you would be better off making a simple fetch 
> of an entity that you know is there.
> 
> 
> Chuck
> 
> 
> On Oct 28, 2010, at 5:38 AM, Farrukh Ijaz wrote:
> 
>> Hi Gurus,
>> 
>> How can I release the JDBC connection that is hooked by 
>> ERXJDBCConnectionAnalyser class?
>> 
>> I've defined following properties:
>> 
>> er.extensions.ERXJDBCAdaptor.useConnectionBroker = true
>> 
>> dbMinConnectionsGLOBAL=1
>> dbMaxConnectionsGLOBAL=5
>> dbMaxCheckoutGLOBAL=600
>> dbDebugLevelGLOBAL=3
>> 
>> I've following code being called one of my direct actions for testing 
>> purpose:
>> 
>> public WOActionResults monitorAction() {
>>    NSMutableDictionary<String, String> dictStatus = new 
>> NSMutableDictionary<String, String>();
>>    for (EOModel m : EOModelGroup.defaultGroup().models()) {
>>        ERXJDBCConnectionAnalyzer ca = new ERXJDBCConnectionAnalyzer(m);
>>        try {
>>            ca.testConnection();
>>            dictStatus.put(m.name(), "OK");
>>        } catch (Throwable t) {
>>            dictStatus.put(m.name(), "Error: " + t.getMessage());
>>        }
>>    }
>>    WOComponent page = pageWithName(Monitor.class.getName());
>>    page.takeValueForKey(dictStatus, "dictStatus");
>>    return page;
>> }
>> 
>> If I set the useConnectionBroker property to "false", it works okay. 
>> Otherwise I get following exception.
>> 
>> er.transaction.adaptor.ConnectionAnalyzer 
>> (ERXJDBCConnectionAnalyzer.java:84)  - Checking JDBC connection with 
>> information {minConnections = "1"; ... ... ... ... ... ...
>> 2010-10-28 15:33:39,297 INFO  XXXXXXXX[-:12345 0] 
>> er.transaction.adaptor.ConnectionAnalyzer 
>> (ERXJDBCConnectionAnalyzer.java:105)  - Trying to create JDBCAdaptor...
>> 2010-10-28 15:33:39,297 INFO  XXXXXXXX[-:12345 0] 
>> er.transaction.adaptor.ConnectionAnalyzer 
>> (ERXJDBCConnectionAnalyzer.java:115)  - Successfully created adaptor 
>> er.extensions.jdbc.ERXJDBCAdaptor
>> 2010-10-28 15:33:39,298 INFO  XXXXXXXX[-:12345 0] 
>> er.transaction.adaptor.ConnectionAnalyzer 
>> (ERXJDBCConnectionAnalyzer.java:126)  - Trying to create plugin...
>> 2010-10-28 15:33:39,298 INFO  XXXXXXXX[-:12345 0] 
>> er.transaction.adaptor.ConnectionAnalyzer 
>> (ERXJDBCConnectionAnalyzer.java:131)  - Created plugin 
>> com.webobjects.jdbcadaptor.PostgresqlPlugIn
>> 2010-10-28 15:33:39,298 INFO  XXXXXXXX[-:12345 0] 
>> er.transaction.adaptor.ConnectionAnalyzer 
>> (ERXJDBCConnectionAnalyzer.java:170)  - Trying to load JDBC driver 
>> org.postgresql.Driver...
>> 2010-10-28 15:33:39,299 INFO  XXXXXXXX[-:12345 0] 
>> er.transaction.adaptor.ConnectionAnalyzer 
>> (ERXJDBCConnectionAnalyzer.java:183)  - Successfully loaded JDBC driver 
>> org.postgresql.Driver
>> 2010-10-28 15:33:39,299 INFO  XXXXXXXX[-:12345 0] 
>> er.transaction.adaptor.ConnectionAnalyzer 
>> (ERXJDBCConnectionAnalyzer.java:192)  - JDBC driver and plugin are loaded, 
>> trying to connect...
>> 2010-10-28 15:33:41,299 WARN  XXXXXXXX[-:12345 0] 
>> er.extensions.jdbc.ERXJDBCConnectionBroker 
>> (ERXJDBCConnectionBroker.java:368)  - Connections Exhausted! Will wait and 
>> try again in loop 0
>> 2010-10-28 15:33:43,300 WARN  XXXXXXXX[-:12345 0] 
>> er.extensions.jdbc.ERXJDBCConnectionBroker 
>> (ERXJDBCConnectionBroker.java:368)  - Connections Exhausted! Will wait and 
>> try again in loop 1
>> 2010-10-28 15:33:45,301 WARN  XXXXXXXX[-:12345 0] 
>> er.extensions.jdbc.ERXJDBCConnectionBroker 
>> (ERXJDBCConnectionBroker.java:368)  - Connections Exhausted! Will wait and 
>> try again in loop 2
>> 
>> How can I enforce ERXJDBCConnectionAnalyser to release connection?
>> 
>> Thanks,
>> 
>> Farrukh
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>> 
>> This email sent to [email protected]
> 
> -- 
> Chuck Hill             Senior Consultant / VP Development
> 
> Practical WebObjects - for developers who want to increase their overall 
> knowledge of WebObjects or who are trying to solve specific problems.    
> http://www.global-village.net/products/practical_webobjects
> 
> 
> 
> 
> 
> 
> 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to