0

The application is developed on gwt and hibernate. I altered one of the table(stasite) to add one more column position which is of size varchar(10) in oracle DB. I added the setters and getters in the entity class. However, when i run the application i am getting this below error - UnplannedEvent is one of the primary table. However when i comment the newly added variable in stasite entity class, application works fine.

**Below is the error -**

    [ERROR] [WARNING] Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@42362b92java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@42362b92
    [ERROR]     at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:571)
    [ERROR]     at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)
    [ERROR]     at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
    [ERROR]     at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
    [ERROR]     at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
    [ERROR] 
    [INFO] [02/11/18 08:45:17:243]  INFO DefaultLoadEventListener:160 - Error performing load command
    [INFO] org.hibernate.exception.JDBCConnectionException: could not load an entity: [com.shared.serviceevent.unplannedevent.entity.UnplannedEvent#10186148]
    [INFO]  at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99)
    [INFO]  at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    [INFO]  at org.hibernate.loader.Loader.loadEntity(Loader.java:1937)
    [INFO]  at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
    [INFO]  at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
    [INFO]  at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270)
    [INFO]  at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
    [INFO]  at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
    [INFO]  at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
    [INFO]  at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
    [INFO]  at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
    [INFO]  at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)
    [INFO]  at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997)
    [INFO]  at org.hibernate.impl.SessionImpl.get(SessionImpl.java:990)
    [INFO]  at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:610)
    [INFO]  at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:585)
    [INFO]  at com.hub.server.common.dao.JpaDao.fetch(JpaDao.java:50)
    [INFO]  at com.hub.server.serviceevent.service.ServiceEventService.getServiceEvent(ServiceEventService.java:163)
    [INFO]  at com.hub.server.serviceevent.service.ServiceEventService.getServiceEvent(ServiceEventService.java:156)
    [INFO]  at com.hub.server.serviceevent.service.ServiceEventService.save(ServiceEventService.java:208)
    [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    [INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [INFO]  at java.lang.reflect.Method.invoke(Method.java:606)
    [INFO]  at net.sf.gilead.gwt.PersistentRemoteService.processCall(PersistentRemoteService.java:174)
    [INFO]  at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)
    [INFO]  at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    [INFO]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
    [INFO]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    [INFO]  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    [INFO]  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
    [INFO]  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    [INFO]  at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    [INFO]  at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    [INFO]  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    [INFO]  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    [INFO]  at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    [INFO]  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    [INFO]  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    [INFO]  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    [INFO]  at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
    [INFO]  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    [INFO]  at org.eclipse.jetty.server.Server.handle(Server.java:370)
    [INFO]  at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    [INFO]  at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    [INFO]  at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    [INFO]  at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    [INFO]  at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    [INFO]  at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    [INFO]  at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    [INFO]  at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    [INFO]  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    [INFO]  at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    [INFO]  at java.lang.Thread.run(Thread.java:745)
    [INFO] Caused by: java.sql.SQLRecoverableException: No more data to read from socket
    [INFO]  at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1157)
    [INFO]  at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:350)
    [INFO]  at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
    [INFO]  at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
    [INFO]  at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)
    [INFO]  at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:886)
    [INFO]  at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
    [INFO]  at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296)
    [INFO]  at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613)
    [INFO]  at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3657)
    [INFO]  at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1495)
    [INFO]  at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
    [INFO]  at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
    [INFO]  at org.hibernate.loader.Loader.getResultSet(Loader.java:1849)
    [INFO]  at org.hibernate.loader.Loader.doQuery(Loader.java:718)
    [INFO]  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
    [INFO]  at org.hibernate.loader.Loader.loadEntity(Loader.java:1933)
    [INFO]  ... 51 more
  • Alain, but the main error is org.hibernate.exception.JDBCConnectionException: could not load an entity: [com.shared.serviceevent.unplannedevent.entity.UnplannedEvent . Moment i comment out the newly added variable in the entity class it works perfectly fine. – user2553198 Nov 01 '18 at 22:52
  • Have you tried doing `SQL> alter session set “_optimizer_join_elimination_enabled”=false;` – Alain Cruz Nov 02 '18 at 00:57
  • One more thing to add- this particular query causing the issue has internally 75 joins with other table. could the issue be related to that ? I have the hibernate code log – user2553198 Nov 02 '18 at 01:42
  • No, the main cause is "No more data to read from socket"; this then causes it not to be able to load an entity. – Mark Rotteveel Nov 02 '18 at 10:40

1 Answers1

0

Have you added @Column on your added field?

If not then add it and try.

Another reason may be because of the mismatch of your column name and name of the variable in entity. So make sure, that you add name of the column as well.

Pooja Aggarwal
  • 1,163
  • 6
  • 14
  • Yes i have added all of those and even column names are matching . – user2553198 Nov 02 '18 at 04:01
  • Was your change in UnplannedEvent this entity? – Pooja Aggarwal Nov 02 '18 at 04:06
  • No. change was is stasite table and there is one to one mapping between unplannedevent and stasite. @OneToOne(fetch = FetchType.EAGER) private StaSite vehicleOnLoanSite; – user2553198 Nov 02 '18 at 04:10
  • Then try adding @JoinColumn and the name of the column which actually is used as foreign key.Can you check if in the table in db it is foreign key or not? – Pooja Aggarwal Nov 02 '18 at 04:16
  • Yes. Foreign key constraint exists in the DB. As mentioned in one of my previous comments, unplanned event table has around 75 inner/outer joins with other tables including stasite. And the particular query has been in place for quite some time. Is it something related to size or the number of columns retrieved by the query . any way to increase that? – user2553198 Nov 02 '18 at 04:40