Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Question Unanswered: Sqlcode: -1040, Sqlstate: 57030

    Hi,

    I'm not a DBA but as long as technical developer should say we are receiving the below exception which based on DB2 documentation means DB2 can't provide new connection,
    We have communicated with our DBA and they are saying they can see they have 300 available connection so they won't increase the max connection (currently 500) and they point the finger at development but from our point of view we simply get this exception and there is nothing we can do.

    Any body's help on this would be highly appreciated since they might have seen this error before or any idea what might actually be the cause of this.

    apparently there is no trace in DB log on this error so from DBA point of view there is no problem, would it be possible that this error caused by a DB2 bug or the error message is misleading and means something else?
    In development it happens a lot.

    SQL1040N

    The maximum number of applications is already connected to the database.

    Explanation:
    The number of applications connected to the database is equal to the maximum value defined in the configuration file for the database.
    The command cannot be processed.
    User Response:
    Wait for other applications to disconnect from the database. If more applications are required to run concurrently, increase the value for maxappls. After all applications disconnect from the database and the database is restarted, the new value takes effect.

    sqlcode: -1040
    sqlstate: 57030






    14:16:31,627 ERROR [http-8003-2] (FraudControlDao) - DataAccessException with sql:select distinct m.SEVERITY from f_neg_text_cat_map m, f_neg_text t, f_cat_mer c where t.TYPE in

    (?, ?) and t.TEXT=? and (m.MAP_CODE=c.CAT_ID or m.MAP_CODE=c.MERCHANT_ID) and m.NEG_TEXT_ID=t.NEG_TEXT_ID and c.MERCHANT_ID=?::Could not get JDBC Connection; nested exception is

    com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -1040, SQLSTATE: 57030, SQLERRMC: null

    org.springframework.jdbc.CannotGetJdbcConnectionEx ception: Could not get JDBC Connection; nested exception is com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -1040, SQLST

    ATE: 57030, SQLERRMC: null

    at org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(DataSourceUtils.java:82)

    at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:576)

    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:640)

    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:669)

    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:677)

    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:709)

    at org.springframework.jdbc.core.JdbcTemplate.queryFo rList(JdbcTemplate.java:775)

    at com.framework.dbcon.jdbc.AbstractSpringJdbcDao.pro cess(AbstractSpringJdbcDao.java:56)

    at com.framework.dbcon.jdbc.AbstractSpringJdbcDao.doQ ueryForMultipleRecords(AbstractSpringJdbcDao.java: 134)

    at com.nps.pos.model.dal.jdbc.FraudControlDao.checkNe gTextString(FraudControlDao.java:252)

    at com.nps.pos.model.dal.jdbc.FraudControlDao.checkNe gText(FraudControlDao.java:171)

    at com.nps.pos.model.dal.jdbc.FraudControlDao.checkNe gTextWithBusCheck(FraudControlDao.java:156)

    at com.nps.ruleengine.common.DBOperator.inNegDb(DBOpe rator.java:60)

    at com.nps.ruleengine.common.FCStatefulRuleSessionImp l.parzeRules(FCStatefulRuleSessionImpl.java:169)

    at com.nps.ruleengine.common.FCStatefulRuleSessionImp l.checkRules(FCStatefulRuleSessionImpl.java:284)

    at com.nps.ruleengine.common.FCRuleExecutor.executeRu les(FCRuleExecutor.java:126)

    at com.nps.fraudcontrol.model.services.FraudCheckServ ice.checkFraud(FraudCheckService.java:58)

    at com.nps.fraudcontrol.model.services.FraudCheckServ iceEndPoint.checkFraud(FraudCheckServiceEndPoint.j ava:91)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    : at com.sun.xml.ws.api.server.InstanceResolver$1.invok e(InstanceResolver.java:246)

    at com.sun.xml.ws.server.InvokerTube$2.invoke(Invoker Tube.java:146)

    at com.sun.xml.ws.server.sei.EndpointMethodHandler.in voke(EndpointMethodHandler.java:257)

    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRe quest(SEIInvokerTube.java:93)

    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:5 98)

    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:55 7)

    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542 )

    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:4 39)

    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSE ndpointImpl.java:243)

    at com.sun.xml.ws.transport.http.HttpAdapter$HttpTool kit.handle(HttpAdapter.java:444)

    at com.sun.xml.ws.transport.http.HttpAdapter.handle(H ttpAdapter.java:244)

    at com.sun.xml.ws.transport.http.servlet.ServletAdapt er.handle(ServletAdapter.java:135)

    at com.sun.xml.ws.transport.http.servlet.WSServletDel egate.doGet(WSServletDelegate.java:129)

    at com.sun.xml.ws.transport.http.servlet.WSServletDel egate.doPost(WSServletDelegate.java:160)

    at com.sun.xml.ws.transport.http.servlet.WSServlet.do Post(WSServlet.java:75)

    at javax.servlet.http.HttpServlet.service(HttpServlet .java:710)

    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)

    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)

    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)

    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)

    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)

    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)

    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)

    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:263)

    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)

    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:584)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)

    at java.lang.Thread.run(Thread.java:619)

    Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -1040, SQLSTATE: 57030, SQLERRMC: null

    at com.ibm.db2.jcc.b.o.a(o.java:3219)

    at com.ibm.db2.jcc.a.bb.q(bb.java:653)

    at com.ibm.db2.jcc.a.bb.p(bb.java:541)

    at com.ibm.db2.jcc.a.bb.l(bb.java:363)

    at com.ibm.db2.jcc.a.bb.d(bb.java:145)

    at com.ibm.db2.jcc.a.b.Sb(b.java:1274)

    at com.ibm.db2.jcc.a.b.a(b.java:1166)

    at com.ibm.db2.jcc.a.b.q(b.java:934)

    at com.ibm.db2.jcc.a.b.a(b.java:702)

    at com.ibm.db2.jcc.a.b.<init>(b.java:305)

    at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 62)

    at org.apache.commons.dbcp.DriverConnectionFactory.cr eateConnection(DriverConnectionFactory.java:37)

    at org.apache.commons.dbcp.PoolableConnectionFactory. makeObject(PoolableConnectionFactory.java:290)

    at org.apache.commons.pool.impl.GenericObjectPool.bor rowObject(GenericObjectPool.java:771)

    at org.apache.commons.dbcp.PoolingDataSource.getConne ction(PoolingDataSource.java:95)

    at org.apache.commons.dbcp.BasicDataSource.getConnect ion(BasicDataSource.java:544)

    at org.springframework.jdbc.datasource.DataSourceUtil s.doGetConnection(DataSourceUtils.java:113)

    at org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(DataSourceUtils.java:79)

  2. #2
    Join Date
    Jan 2009
    Posts
    2
    is there any way we can trace this from DB machine and see what's going on?
    perhaps we can suggest something to our DBA and ask them to perform or check something that they might have missed checking?

    Quote Originally Posted by mv1351
    Hi,

    I'm not a DBA but as long as technical developer should say we are receiving the below exception which based on DB2 documentation means DB2 can't provide new connection,
    We have communicated with our DBA and they are saying they can see they have 300 available connection so they won't increase the max connection (currently 500) and they point the finger at development but from our point of view we simply get this exception and there is nothing we can do.

    Any body's help on this would be highly appreciated since they might have seen this error before or any idea what might actually be the cause of this.

    apparently there is no trace in DB log on this error so from DBA point of view there is no problem, would it be possible that this error caused by a DB2 bug or the error message is misleading and means something else?
    In development it happens a lot.

    SQL1040N

    The maximum number of applications is already connected to the database.

    Explanation:
    The number of applications connected to the database is equal to the maximum value defined in the configuration file for the database.
    The command cannot be processed.
    User Response:
    Wait for other applications to disconnect from the database. If more applications are required to run concurrently, increase the value for maxappls. After all applications disconnect from the database and the database is restarted, the new value takes effect.

    sqlcode: -1040
    sqlstate: 57030






    14:16:31,627 ERROR [http-8003-2] (FraudControlDao) - DataAccessException with sql:select distinct m.SEVERITY from f_neg_text_cat_map m, f_neg_text t, f_cat_mer c where t.TYPE in

    (?, ?) and t.TEXT=? and (m.MAP_CODE=c.CAT_ID or m.MAP_CODE=c.MERCHANT_ID) and m.NEG_TEXT_ID=t.NEG_TEXT_ID and c.MERCHANT_ID=?::Could not get JDBC Connection; nested exception is

    com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -1040, SQLSTATE: 57030, SQLERRMC: null

    org.springframework.jdbc.CannotGetJdbcConnectionEx ception: Could not get JDBC Connection; nested exception is com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -1040, SQLST

    ATE: 57030, SQLERRMC: null

    at org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(DataSourceUtils.java:82)

    at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:576)

    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:640)

    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:669)

    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:677)

    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:709)

    at org.springframework.jdbc.core.JdbcTemplate.queryFo rList(JdbcTemplate.java:775)

    at com.framework.dbcon.jdbc.AbstractSpringJdbcDao.pro cess(AbstractSpringJdbcDao.java:56)

    at com.framework.dbcon.jdbc.AbstractSpringJdbcDao.doQ ueryForMultipleRecords(AbstractSpringJdbcDao.java: 134)

    at com.nps.pos.model.dal.jdbc.FraudControlDao.checkNe gTextString(FraudControlDao.java:252)

    at com.nps.pos.model.dal.jdbc.FraudControlDao.checkNe gText(FraudControlDao.java:171)

    at com.nps.pos.model.dal.jdbc.FraudControlDao.checkNe gTextWithBusCheck(FraudControlDao.java:156)

    at com.nps.ruleengine.common.DBOperator.inNegDb(DBOpe rator.java:60)

    at com.nps.ruleengine.common.FCStatefulRuleSessionImp l.parzeRules(FCStatefulRuleSessionImpl.java:169)

    at com.nps.ruleengine.common.FCStatefulRuleSessionImp l.checkRules(FCStatefulRuleSessionImpl.java:284)

    at com.nps.ruleengine.common.FCRuleExecutor.executeRu les(FCRuleExecutor.java:126)

    at com.nps.fraudcontrol.model.services.FraudCheckServ ice.checkFraud(FraudCheckService.java:58)

    at com.nps.fraudcontrol.model.services.FraudCheckServ iceEndPoint.checkFraud(FraudCheckServiceEndPoint.j ava:91)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    : at com.sun.xml.ws.api.server.InstanceResolver$1.invok e(InstanceResolver.java:246)

    at com.sun.xml.ws.server.InvokerTube$2.invoke(Invoker Tube.java:146)

    at com.sun.xml.ws.server.sei.EndpointMethodHandler.in voke(EndpointMethodHandler.java:257)

    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRe quest(SEIInvokerTube.java:93)

    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:5 98)

    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:55 7)

    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542 )

    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:4 39)

    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSE ndpointImpl.java:243)

    at com.sun.xml.ws.transport.http.HttpAdapter$HttpTool kit.handle(HttpAdapter.java:444)

    at com.sun.xml.ws.transport.http.HttpAdapter.handle(H ttpAdapter.java:244)

    at com.sun.xml.ws.transport.http.servlet.ServletAdapt er.handle(ServletAdapter.java:135)

    at com.sun.xml.ws.transport.http.servlet.WSServletDel egate.doGet(WSServletDelegate.java:129)

    at com.sun.xml.ws.transport.http.servlet.WSServletDel egate.doPost(WSServletDelegate.java:160)

    at com.sun.xml.ws.transport.http.servlet.WSServlet.do Post(WSServlet.java:75)

    at javax.servlet.http.HttpServlet.service(HttpServlet .java:710)

    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)

    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)

    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)

    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)

    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)

    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)

    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)

    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:263)

    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)

    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:584)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)

    at java.lang.Thread.run(Thread.java:619)

    Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -1040, SQLSTATE: 57030, SQLERRMC: null

    at com.ibm.db2.jcc.b.o.a(o.java:3219)

    at com.ibm.db2.jcc.a.bb.q(bb.java:653)

    at com.ibm.db2.jcc.a.bb.p(bb.java:541)

    at com.ibm.db2.jcc.a.bb.l(bb.java:363)

    at com.ibm.db2.jcc.a.bb.d(bb.java:145)

    at com.ibm.db2.jcc.a.b.Sb(b.java:1274)

    at com.ibm.db2.jcc.a.b.a(b.java:1166)

    at com.ibm.db2.jcc.a.b.q(b.java:934)

    at com.ibm.db2.jcc.a.b.a(b.java:702)

    at com.ibm.db2.jcc.a.b.<init>(b.java:305)

    at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 62)

    at org.apache.commons.dbcp.DriverConnectionFactory.cr eateConnection(DriverConnectionFactory.java:37)

    at org.apache.commons.dbcp.PoolableConnectionFactory. makeObject(PoolableConnectionFactory.java:290)

    at org.apache.commons.pool.impl.GenericObjectPool.bor rowObject(GenericObjectPool.java:771)

    at org.apache.commons.dbcp.PoolingDataSource.getConne ction(PoolingDataSource.java:95)

    at org.apache.commons.dbcp.BasicDataSource.getConnect ion(BasicDataSource.java:544)

    at org.springframework.jdbc.datasource.DataSourceUtil s.doGetConnection(DataSourceUtils.java:113)

    at org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(DataSourceUtils.java:79)

  3. #3
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    check the value of MAXAPPLS for the database to which you are connecting...and post the same

    on side note also post the db manager parameters
    MAX_COORDAGENTS
    MAX_CONNECTIONS

    would be great if you could post both db cfg and dbm cfg.....

    How many users are present when the connection size is maxing out??? Ideally it should be more than 300.... if it is less than 300 then it is a problem with your application as each connection is making more than 1 connection to the db which should not be the case.....
    IBM Certified Database Associate, DB2 9 for LUW

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    It is possible that there is more than one agent per connection if parallelism is being used. That could be the case for intra-partition query parallelism. It is also not unusual to have some parallelism when running utilities like a backup. But I don't know if that could account for the discrepancy between 300 and 500.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •