Announcement Announcement Module
Collapse
No announcement yet.
Statement cache size has not been set error while retieving Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Statement cache size has not been set error while retieving

    I am getting the following error while trying to access the data from the data source configured in the weblogic 8.1
    I am able to execute the same code using DBCP.
    I am using Oracle 9.2


    Following is the snippet from my springconfig xml
    <bean id="applicationServerEnviromentProperties"
    class="org.springframework.beans.factory.config.Pr opertiesFactoryBean">
    <property name="properties">
    <props>
    <prop key="java.naming.factory.initial">
    weblogic.jndi.WLInitialContextFactory
    </prop>
    <prop key="java.naming.provider.url">t3://dstate-ap03:7119
    </prop>
    </props>
    </property>
    </bean>

    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="resourceRef">
    <value>false</value>
    </property>
    <property name="jndiName">
    <!--<value>jdbc/amengineInputPool</value>-->
    <value>service/jdbc/CharacteristicsDataSource</value>
    </property>
    <property name="jndiEnvironment">
    <ref local="applicationServerEnviromentProperties"/>
    </property>
    </bean>



    Source code:
    final JdbcTemplate template = new JdbcTemplate(getDataSource());

    final String sqlQuery = this.allProductTypeSql;
    System.out.println("~~~SQL QUERY: " + sqlQuery);

    final java.util.List declaredParameters = new java.util.ArrayList();
    declaredParameters
    .add(new SqlParameter(CUSIP_ID_COLUMN, Types.VARCHAR));
    System.out.println("~~~declaredParameters: " + declaredParameters);

    final PreparedStatementCreatorFactory psFactory = new PreparedStatementCreatorFactory(
    sqlQuery, declaredParameters);
    System.out.println("~~~psFactory: " + psFactory);
    List charsList = (List) template.query(psFactory
    .newPreparedStatementCreator(new Object[] { cusip }),
    new ResultSetExtractor() {
    public Object extractData(ResultSet rs)
    throws SQLException, DataAccessException {
    return getCharacteristics(rs);
    }
    });
    System.out.println("~~~charsList: " + charsList);



    I was able to get upto the debug statement "~~~psFactory:" not beyond that. (I am not sure what is causing the problem - newPreparedStatementCreator or ResultSetExtractor)
    Any help is greatly appreciated.



    Stack trace:
    ~~~SQL QUERY: select FINS_ID as id, FINS_CUSIP_ID as cusip, FINS_INIT_CPN_RT as
    coupon, FINS_TERM_AMT as term, FINS_ORIG_PAR_AMT as origPar,
    FINS_ISS_DT as issueDate, FINS_ORGNN_DT as origDate from FINS_CHRSC
    where FINS_CUSIP_ID=?

    ~~~declaredParameters: [org.springframework.jdbc.core.SqlParameter@18c4a7f]
    ~~~psFactory: org.springframework.jdbc.core.PreparedStatementCre atorFactory@135da43
    DEBUG main: Executing SQL query [select FINS_ID as id, FINS_CUSIP_ID as cusip, FINS_INIT_CPN_RT as
    coupon, FINS_TERM_AMT as term, FINS_ORIG_PAR_AMT as origPar,
    FINS_ISS_DT as issueDate, FINS_ORGNN_DT as origDate from FINS_CHRSC
    where FINS_CUSIP_ID=?
    ]
    3365 [main] DEBUG org.springframework.jdbc.core.JdbcTemplate - Executing SQL query [select FINS_ID as id, FINS_CUSIP_ID as cusip, FINS_INIT_CPN_RT as
    coupon, FINS_TERM_AMT as term, FINS_ORIG_PAR_AMT as origPar,
    FINS_ISS_DT as issueDate, FINS_ORGNN_DT as origDate from FINS_CHRSC
    where FINS_CUSIP_ID=?
    ]
    DEBUG main: Opening JDBC connection
    3365 [main] DEBUG org.springframework.jdbc.datasource.DataSourceUtil s - Opening JDBC connection
    DEBUG main: Unable to translate SQLException with errorCode '17095', will now try the fallback translator
    3435 [main] DEBUG org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator - Unable to translate SQLException with errorCode '17095', will now try the fallback translator
    DEBUG main: Translating SQLException with SQLState 'null' and errorCode '17095' and message [Statement cache size has not been set]; SQL was [select FINS_ID as id, FINS_CUSIP_ID as cusip, FINS_INIT_CPN_RT as
    coupon, FINS_TERM_AMT as term, FINS_ORIG_PAR_AMT as origPar,
    FINS_ISS_DT as issueDate, FINS_ORGNN_DT as origDate from FINS_CHRSC
    where FINS_CUSIP_ID=?
    ] for task [executing PreparedStatementCallback [PreparedStatementCreatorFactory.PreparedStatementC reatorImpl: sql=[select FINS_ID as id, FINS_CUSIP_ID as cusip, FINS_INIT_CPN_RT as
    coupon, FINS_TERM_AMT as term, FINS_ORIG_PAR_AMT as origPar,
    FINS_ISS_DT as issueDate, FINS_ORGNN_DT as origDate from FINS_CHRSC
    where FINS_CUSIP_ID=?
    ]: params=[re252301]]]

  • #2
    Can you post the "JDBCConnectionPool" configuration from the WebLogic config.xml. Is there a StatementCacheSize set there?

    Comment


    • #3
      Statement cache size has not been set error while retieving

      Following is the connection pool which is being used by the data source.

      <JDBCConnectionPool CapacityIncrement="1"
      DriverName="oracle.jdbc.driver.OracleDriver"
      InitialCapacity="20" LoginDelaySeconds="1" MaxCapacity="20"
      Name="sdsInputPool"
      Password="{3DES}VDria1f3jdwXmXh5u/xw=="
      Properties="user=CATEST" RefreshMinutes="10"
      ShrinkPeriodMinutes="15" ShrinkingEnabled="true"
      StatementCacheSize="10" Targets="sds-test-cluster"
      TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
      TestTableName="dual" URL="jdbc:oracle:thin:@dstate-db03:1521:ZOR_ZA01"/>

      Comment


      • #4
        Well, that looks OK. Never seen this error before, so I'm looking for something that is out of the ordinary. I'm using WebLogic 8.1 and Oracle 9.2 all the time and it works like a charm. What version of the JDBC driver are you using? The one that ships with Weblogic or a different one? While we are at it - what' service pack are you on for WL / Oracle? What about other queries - are they working OK?

        Comment


        • #5
          We are using weblogic 8.1 spk 2

          When I use Oracle JDBC driver 10.1.0.2.0 (preceding weblogic.jar)
          I am getting the following exception
          java.sql.SQLException: Statement cache size has not been set
          at weblogic.rjvm.BasicOutboundRequest.sendReceive(Bas icOutboundRequest.java:108)
          at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicR emoteRef.java:137)
          at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic _jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4 CConnection_812_WLStub.prepareStatement(Unknown Source)
          at weblogic.jdbc.rmi.SerialConnection.prepareStatemen t(SerialConnection.java:196)
          at org.springframework.jdbc.core.PreparedStatementCre atorFactory$PreparedStatementCreatorImpl.createPre paredStatement(PreparedStatementCreatorFactory.jav a:212)
          at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:427)
          at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:475)
          at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:506)
          at com.wlspolicy.spring.test.CharacteristicJDBCDaoImp l.getProductCharacteristics(CharacteristicJDBCDaoI mpl.java:80)
          at com.wlspolicy.spring.test.TestCharSvcForJdbcTempla tePsFactory.testGetProductCharacteristicsProductTy pe(TestCharSvcForJdbcTemplatePsFactory.java:45)
          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 com.wlspolicy.spring.test.TestCharSvcForJdbcTempla tePsFactory.main(TestCharSvcForJdbcTemplatePsFacto ry.java:19)




          When I use Oracle JDBC Driver version - 9.0.2.0.0 (preceding weblogic.jar)
          or
          When I precede weblogic.jar before oracle drivers.
          I am getting the following exception.

          2634 [main] DEBUG org.springframework.beans.BeanWrapperImpl - About to invoke write method [public void org.springframework.jdbc.support.SQLErrorCodes.set DataIntegrityViolationCodes(java.lang.String[])] on object of class [org.springframework.jdbc.support.SQLErrorCodes]
          DEBUG main: Invoked write method [public void org.springframework.jdbc.support.SQLErrorCodes.set DataIntegrityViolationCodes(java.lang.String[])] with value [[Ljava.lang.String;@1d98a]
          2634 [main] DEBUG org.springframework.beans.BeanWrapperImpl - Invoked write method [public void org.springframework.jdbc.support.SQLErrorCodes.set DataIntegrityViolationCodes(java.lang.String[])] with value [[Ljava.lang.String;@1d98a]
          DEBUG main: Invoking BeanPostProcessors before initialization of bean 'Sybase'
          2634 [main] DEBUG org.springframework.beans.factory.support.DefaultL istableBeanFactory - Invoking BeanPostProcessors before initialization of bean 'Sybase'
          DEBUG main: Invoking BeanPostProcessors after initialization of bean 'Sybase'
          2634 [main] DEBUG org.springframework.beans.factory.support.DefaultL istableBeanFactory - Invoking BeanPostProcessors after initialization of bean 'Sybase'
          INFO main: SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase]
          2634 [main] INFO org.springframework.jdbc.support.SQLErrorCodesFact ory - SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase]
          DEBUG main: Looking up default SQLErrorCodes for DataSource [ClusterableRemoteRef(-5843036765243736097S:dstate-ap03:[7119,7119,-1,-1,7119,-1,-1,0,0]:dstate-ap03:7119,dstate-ap03-1:7119:amengine812-test:amengine812-test-cl01 [-5843036765243736097S:dstate-ap03:[7119,7119,-1,-1,7119,-1,-1,0,0]:dstate-ap03:7119,dstate-ap03-1:7119:amengine812-test:amengine812-test-cl01/282])/282]
          2634 [main] DEBUG org.springframework.jdbc.support.SQLErrorCodesFact ory - Looking up default SQLErrorCodes for DataSource [ClusterableRemoteRef(-5843036765243736097S:dstate-ap03:[7119,7119,-1,-1,7119,-1,-1,0,0]:dstate-ap03:7119,dstate-ap03-1:7119:amengine812-test:amengine812-test-cl01 [-5843036765243736097S:dstate-ap03:[7119,7119,-1,-1,7119,-1,-1,0,0]:dstate-ap03:7119,dstate-ap03-1:7119:amengine812-test:amengine812-test-cl01/282])/282]
          DEBUG main: Opening JDBC connection
          2644 [main] DEBUG org.springframework.jdbc.datasource.DataSourceUtil s - Opening JDBC connection
          java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
          at weblogic.rmi.internal.StubGenerator.generateStub(S tubGenerator.java:812)
          at weblogic.rmi.internal.StubGenerator.generateStub(S tubGenerator.java:797)
          at weblogic.rmi.extensions.StubFactory.getStub(StubFa ctory.java:79)
          at weblogic.rmi.utils.io.RemoteObjectReplacer.resolve Object(RemoteObjectReplacer.java:237)
          at weblogic.rmi.internal.StubInfo.readResolve(StubInf o.java:142)
          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:324)
          at java.io.ObjectStreamClass.invokeReadResolve(Object StreamClass.java:925)
          at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1655)
          at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
          at java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1845)
          at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1769)
          at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1646)
          at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
          at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:324)
          at weblogic.common.internal.ChunkedObjectInputStream. readObject(ChunkedObjectInputStream.java:120)
          at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgA bbrevInputStream.java:117)
          at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO .java:56)
          at weblogic.rjvm.ResponseImpl.unmarshalReturn(Respons eImpl.java:159)
          at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke( ReplicaAwareRemoteRef.java:285)
          at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke( ReplicaAwareRemoteRef.java:244)
          at weblogic.jdbc.common.internal.RmiDataSource_812_WL Stub.getConnection(Unknown Source)
          at org.springframework.jdbc.datasource.DataSourceUtil s.doGetConnection(DataSourceUtils.java:190)
          at org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(DataSourceUtils.java:159)
          at org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(DataSourceUtils.java:135)
          at org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(JdbcUtils.java:114)
          at org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(JdbcUtils.java:154)
          at org.springframework.jdbc.support.SQLErrorCodesFact ory.getErrorCodes(SQLErrorCodesFactory.java:185)
          at org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator.setDataSource(SQLErrorCodeSQLExc eptionTranslator.java:113)
          at org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator.<init>(SQLErrorCodeSQLExceptionT ranslator.java:92)
          at org.springframework.jdbc.support.JdbcAccessor.getE xceptionTranslator(JdbcAccessor.java:81)
          at org.springframework.jdbc.support.JdbcAccessor.afte rPropertiesSet(JdbcAccessor.java:117)
          at org.springframework.jdbc.core.JdbcTemplate.afterPr opertiesSet(JdbcTemplate.java:207)
          at org.springframework.jdbc.core.JdbcTemplate.<init>( JdbcTemplate.java:127)
          at org.springframework.jdbc.core.support.JdbcDaoSuppo rt.setDataSource(JdbcDaoSupport.java:58)
          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:324)
          at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:790)
          at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:685)
          at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:826)
          at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:853)
          at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:842)
          at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:874)
          at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:688)
          at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:325)
          at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:260)
          at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:221)
          at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
          at com.wlspolicy.spring.test.LookupFactory.getCharact ericsJdbcDao(LookupFactory.java:64)
          at com.wlspolicy.spring.test.TestCharSvcForJdbcTempla tePsFactory.setUp(TestCharSvcForJdbcTemplatePsFact ory.java:29)
          at junit.framework.TestCase.runBare(TestCase.java:125 )
          at junit.framework.TestResult$1.protect(TestResult.ja va:106)
          at junit.framework.TestResult.runProtected(TestResult .java:124)
          at junit.framework.TestResult.run(TestResult.java:109 )
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.framework.TestSuite.runTest(TestSuite.java:2 08)
          at junit.framework.TestSuite.run(TestSuite.java:203)
          at junit.textui.TestRunner.doRun(TestRunner.java:116)
          at junit.textui.TestRunner.doRun(TestRunner.java:109)
          at junit.textui.TestRunner.run(TestRunner.java:72)
          at junit.textui.TestRunner.run(TestRunner.java:57)
          at com.wlspolicy.spring.test.TestCharSvcForJdbcTempla tePsFactory.main(TestCharSvcForJdbcTemplatePsFacto ry.java:19)
          Caused by: java.lang.ArrayIndexOutOfBoundsException: 210
          at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic _jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4 CConnection_812_WLStub.ensureInitialized(Unknown Source)
          at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic _jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4 CConnection_812_WLStub.<init>(Unknown Source)
          ... 70 more



          I really appreciate your help.

          Thanks,
          Raj.
          email: [email protected]

          Comment


          • #6
            This is strange. If you have WebLogic support, then I would suggest you open a case with them. They would be better equipped to provide a solution.

            Does a test of the pool succeed using the WL Console? Can you run queries using straight JDBC without using Spring?

            Also, are you using the JDBC driver that came with WebLogic?

            Comment

            Working...
            X