PDA

View Full Version : StatementCacheSize?:ORACLE:WebsphereAppServer 5.1



mavisakal
Sep 9th, 2004, 07:10 AM
Hi everybody,
My configuration:
- 1 datasource : Oracle 9i - (a table named User exists)
- using Websphere 5.1 as application server
- using spring+hibernate

My datasource definition in applicationContext.xml is like this:


<bean id="OracleDataSourceJNDI" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jdbc/OraDS</value>
</property>
</bean>


I can insert my first record in User table appropriately, but when I
try to insert my second record, I get the following exception:


&#91;09.09.2004 14&#58;51&#58;16&#58;641 EEST&#93; 1336424 RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown&#58; class java.lang.NullPointerException
&#91;09.09.2004 14&#58;51&#58;17&#58;094 EEST&#93; 1336424 WebGroup E SRVE0026E&#58; &#91;Servlet Error&#93;-&#91;&#93;&#58; java.lang.NullPointerException
at oracle.jdbc.dbaccess.DBData.clearItem&#40;DBData.java&#58; 431&#41;
at oracle.jdbc.dbaccess.DBDataSetImpl.clearItem&#40;DBDat aSetImpl.java&#58;3528&#41;
at oracle.jdbc.driver.OraclePreparedStatement.clearPa rameters&#40;OraclePreparedStatement.java&#58;3401&#41;
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.resetSt atement&#40;WSJdbcConnection.java&#58;1762&#41;
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepare Statement&#40;WSJdbcConnection.java&#58;1458&#41;
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepare Statement&#40;WSJdbcConnection.java&#58;1424&#41;
at net.sf.hibernate.impl.BatcherImpl.getPreparedState ment&#40;BatcherImpl.java&#58;257&#41;
at net.sf.hibernate.impl.BatcherImpl.prepareStatement &#40;BatcherImpl.java&#58;61&#41;
at net.sf.hibernate.impl.BatcherImpl.prepareStatement &#40;BatcherImpl.java&#58;56&#41;
at net.sf.hibernate.impl.BatcherImpl.prepareBatchStat ement&#40;BatcherImpl.java&#58;109&#41;
at net.sf.hibernate.persister.EntityPersister.insert&#40; EntityPersister.java&#58;460&#41;
at net.sf.hibernate.persister.EntityPersister.insert&#40; EntityPersister.java&#58;442&#41;
at net.sf.hibernate.impl.ScheduledInsertion.execute&#40;S cheduledInsertion.java&#58;29&#41;
at net.sf.hibernate.impl.SessionImpl.executeAll&#40;Sessi onImpl.java&#58;2418&#41;
at net.sf.hibernate.impl.SessionImpl.execute&#40;SessionI mpl.java&#58;2371&#41;
at net.sf.hibernate.impl.SessionImpl.flush&#40;SessionImp l.java&#58;2240&#41;
at net.sf.hibernate.transaction.JDBCTransaction.commi t&#40;JDBCTransaction.java&#58;61&#41;
at org.springframework.orm.hibernate.HibernateTransac tionManager.doCommit&#40;HibernateTransactionManager.j ava&#58;460&#41;
at org.springframework.transaction.support.AbstractPl atformTransactionManager.commit&#40;AbstractPlatformTr ansactionManager.java&#58;373&#41;
at org.springframework.transaction.interceptor.Transa ctionAspectSupport.doCommitTransactionAfterReturni ng&#40;TransactionAspectSupport.java&#58;241&#41;
at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke&#40;TransactionInterceptor.jav a&#58;66&#41;
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed&#40;ReflectiveMethodInvocation.java &#58;138&#41;
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke&#40;JdkDynamicAopProxy.java&#58;152&#41;
at $Proxy0.saveUser&#40;Unknown Source&#41;
at com.elikasu.springtemplate.web.user.UserAction.sav e&#40;UserAction.java&#58;106&#41;
at sun.reflect.NativeMethodAccessorImpl.invoke0&#40;Nativ e Method&#41;
at sun.reflect.NativeMethodAccessorImpl.invoke&#40;Native MethodAccessorImpl.java&#58;79&#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke&#40;De legatingMethodAccessorImpl.java&#58;41&#41;
at java.lang.reflect.Method.invoke&#40;Method.java&#58;386&#41;
at org.apache.struts.actions.DispatchAction.dispatchM ethod&#40;DispatchAction.java&#58;280&#41;
at org.apache.struts.actions.DispatchAction.execute&#40;D ispatchAction.java&#58;216&#41;
at org.springframework.web.struts.DelegatingActionPro xy.execute&#40;DelegatingActionProxy.java&#58;104&#41;
at org.apache.struts.action.RequestProcessor.processA ctionPerform&#40;RequestProcessor.java&#58;484&#41;
at org.apache.struts.action.RequestProcessor.process&#40; RequestProcessor.java&#58;274&#41;
at org.apache.struts.action.ActionServlet.process&#40;Act ionServlet.java&#58;1482&#41;
at org.apache.struts.action.ActionServlet.doPost&#40;Acti onServlet.java&#58;525&#41;
at javax.servlet.http.HttpServlet.service&#40;HttpServlet .java&#58;760&#41;
at javax.servlet.http.HttpServlet.service&#40;HttpServlet .java&#58;853&#41;
at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService&#40;StrictServletInstance.java&#58;110&#41;
at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service&#40;StrictLifecycleServlet.java&#58;174&#41;
at com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice&#40;StrictLifecycleServlet.java&#58;313&#41;
at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service&#40;StrictLifecycleServlet.java&#58;116&#41;
at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice&#40;ServletInstance.java&#58;283&#41;
at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch&#40;ValidServletReferenceState.java&#58; 42&#41;
at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch&#40;ServletInstanceReference.java&#58;40&#41;
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter&#40;WebAppFilterChain.java&#58;76&#41;
at com.opensymphony.module.sitemesh.filter.PageFilter .parsePage&#40;PageFilter.java&#58;142&#41;
at com.opensymphony.module.sitemesh.filter.PageFilter .doFilter&#40;PageFilter.java&#58;58&#41;
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter&#40;FilterInstanceWrapper.java&#58;132&#41;
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter&#40;WebAppFilterChain.java&#58;71&#41;
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch&#40;WebAppRequestDispatcher. java&#58;974&#41;
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch&#40;WebAppRequestDispatcher.java&#58;564&#41;
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward&#40;WebAppRequestDispatcher.java&#58;200&#41;
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForwar d&#40;WebAppInvoker.java&#58;119&#41;
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleIn vocationHook&#40;WebAppInvoker.java&#58;276&#41;
at com.ibm.ws.webcontainer.cache.invocation.CachedInv ocation.handleInvocation&#40;CachedInvocation.java&#58;71&#41;
at com.ibm.ws.webcontainer.cache.invocation.Cacheable InvocationContext.invoke&#40;CacheableInvocationContex t.java&#58;116&#41;
at com.ibm.ws.webcontainer.srp.ServletRequestProcesso r.dispatchByURI&#40;ServletRequestProcessor.java&#58;186&#41;
at com.ibm.ws.webcontainer.oselistener.OSEListenerDis patcher.service&#40;OSEListener.java&#58;334&#41;
at com.ibm.ws.webcontainer.http.HttpConnection.handle Request&#40;HttpConnection.java&#58;56&#41;
at com.ibm.ws.http.HttpConnection.readAndHandleReques t&#40;HttpConnection.java&#58;618&#41;
at com.ibm.ws.http.HttpConnection.run&#40;HttpConnection. java&#58;443&#41;
at com.ibm.ws.util.ThreadPool$Worker.run&#40;ThreadPool.j ava&#58;672&#41;



When I started to seek the problem source, I found Statement cache size:
property with a value 10 in Websphere data source
configuration. I changed the value to 0, and the problem solved. I did't get the exception above.

We have been using Statement cache size: property set to a value greater than 0 since we started using spring+hibernate.

So what's with the 'statement cache size'? Any idea?
Thanks
[/b]

cunparis
Jun 7th, 2006, 03:07 AM
When I started to seek the problem source, I found Statement cache size:
property with a value 10 in Websphere data source
configuration. I changed the value to 0, and the problem solved. I did't get the exception above.

We have been using Statement cache size: property set to a value greater than 0 since we started using spring+hibernate.

So what's with the 'statement cache size'? Any idea?
Thanks
[/b]

I just stumbled on this problem and fortunately I found your solution which works for me as well. I'm using websphere 6 + hibernate 3 + oracle with 9.2.0.0 drivers. Any ideas?

-Michael

mzeibig
Jun 7th, 2006, 03:34 AM
Have a look at this:
http://forum.hibernate.org/viewtopic.php?t=934050

You will need a newer JDBC-Driver.

MfG Mirko

cunparis
Jun 7th, 2006, 07:59 AM
Have a look at this:
http://forum.hibernate.org/viewtopic.php?t=934050

You will need a newer JDBC-Driver.

MfG Mirko

9.2.0.5 fix it. had to put it both on the WAS server and in our WAR.

Thanks!
-Michael