ok, setting acquireRetryAttempts=0 was critical, and then I didn't want constant logging while the database is down so I also set acquireRetryDelay=10000 though I would really like to just turn it off completely as it seems to just keep retrying on some asynchronous thread to reconnect to the database....I know the seam thread returned as firefox processed the response and correctly showed the error page.  The full settings needed to work with seam are below if anyone needs it.  This is the c3p0 seam combination to use.  I have tested database goes down and using pages needing database and using pages not needing databases.  I then brought it back up.

My "only" complaint is that when database comes back online, you have to make enough requests which will get all connections running again.  When I tried fixing that, I kept running into trouble and breaking the previous test cases which are more important to work.

INFO: N/A Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@bbfd661c [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@c96a0f87 [ acquireIncrement -> 3, acquireRetryAttempts -> 0, acquireRetryDelay -> 10000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge5io89c1aeu1uqjt7o|96e8ba, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 20, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@7e705c81 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1hge5io89c1aeu1uqjt7o|e4ef27, jdbcUrl -> jdbc:log4jdbc:postgresql://localhost/requirements, properties -> {user=******, password=******, autocommit=true, release_mode=auto} ], preferredTestQuery -> select 1, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> 1hge5io89c1aeu1uqjt7o|1f19f14, numHelperThreads -> 3 ]


On Fri, Jun 4, 2010 at 2:27 AM, Steve Waldman <swaldman@mchange.com> wrote:
dean,

i'm sorry for the slow response.

if you want to log Connection events (acquistion/check-out/check-in/destruction), one way to do that is to implement a simple ConnectionCustomizer and then set c3p0.connectionCustomizerClassName. It's very easy to do; see the API docs for ConnectionCustomizer. (I think I'll try to include convenience implementations of life-cycle event logging Customizers in the next release of c3p0.)

i'm not sure what seam is doing when the database is down. as far as c3p0 is concerned, clients should hang wait()ing when no DB Connections can be acquired, BUT for no more than c3p0.checkoutTimeout milliseconds if that config parameter is set to anything greater than zero. you may want to try that.

   smiles,
      steve



On Jun 2, 2010, at 7:02 PM, Dean Hiller wrote:

I am still getting weird behavior between seam and c3p0.  Is there any logging on c3p0 apis especially on the method calls getConnection and close and hopefully running the test sql as well.  I looked at C3P0ConnectionProvider.java which didn't seem to have logging on the basics getConnection and close :(.

My settings are at the bottom of the email(most are the defaults), but I can use all pages of the seam application that are dynamic and don't need the database just fine right up until I use the database 6 times(minPoolSize=5).  I do see c3p0 testing the connection after the db failures!!!! sweeeet!!! that is working, but then after 6 times, the application is no longer accessible by anyone :(.  I believe the problem and I don't know if this is solvable is that seam uses a pretty standard pattern on every request...getConnection.....close regardless of if it needs the database or not.  It works fine with postgres driver but when I use c3p0, after all the connections have been tested and discarded, seam ends up with an infinite redirect problem...http request, get connection failure, redirect to error page, http request for error page, get connection failure and all over again and again.  I would like the non-database pages to still be usable while the db is down though :(.  It is probably too much to ask that c3p0 have proxy connections it gives out(as many as it needs) and only give those proxies a real connection from the pool when it actually runs some sql.....that would be a pain.  I wonder if there is some other way of solving this though?????  getConnection can't fail or seam ends up in infinite redirect.  any ideas on getting around that?

INFO: N/A Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@386edb0 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@962472a [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge1zq881xl954rz6htee|4ace42, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 20, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@376b610 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1hge1zq881xl954rz6htee|936f52, jdbcUrl -> jdbc:log4jdbc:postgresql://localhost/saasplatform, properties -> {user=******, password=******, autocommit=true, release_mode=auto} ], preferredTestQuery -> select 1, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> 1hge1zq881xl954rz6htee|92325d, numHelperThreads -> 3 ]

thanks,
Dean
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo_______________________________________________
c3p0-users mailing list
c3p0-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/c3p0-users