0

I am trying to upgrade from jconn2 to jconn4. The issue that i am facing is that c3p0 is notworking as expected. Quick online search says that it supports jconn4 completely, but i get the below exception.

com.sybase.jdbc4.jdbc.SybSQLException: SQL Anywhere Error -685: Resource governor for 'prepared statements' exceeded
    at com.sybase.jdbc4.tds.Tds.processEed(Tds.java:4003)
    at com.sybase.jdbc4.tds.Tds.nextResult(Tds.java:3093)
    at com.sybase.jdbc4.jdbc.ResultGetter.nextResult(ResultGetter.java:78)
    at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:289)
    at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:271)
    at com.sybase.jdbc4.jdbc.SybStatement.queryLoop(SybStatement.java:2408)
    at com.sybase.jdbc4.jdbc.SybStatement.executeQuery(SybStatement.java:2394)
    at com.sybase.jdbc4.jdbc.SybPreparedStatement.executeQuery(SybPreparedStatement.java:257)

Any suggestions on how to tackle this issue??/

Prateek
  • 35
  • 1
  • 7

1 Answers1

0

It looks like your issue is too many prepared statements open, relative to max_statement_count defined on your server.

The simplest thing to do would just be to turn Statement caching off in c3p0, i.e. make sure that the c3p0 properties maxStatements and maxStatementsPerConnection are set to 0. If you want the performance benefits of statement caching, make sure that maxStatements is set to a value significantly lower than the server-side max_statement_count. You could also turn the "resource governor" off by setting max_statement_count to zero, although Sybase seems to discourage that.

See also c3p0 docs re Statement caching.

Steve Waldman
  • 13,689
  • 1
  • 35
  • 45