|
|
|
Dfgqq Dfgqq
|
Hi All
I am a newcomer of hibernatespatial. Currently we have a GIS project (the backend db is oracle 11g). I want to konw two things: 1 Did anyone use hibernatespatial for large-scale application before? 2 How well does hibernatespatial work with oracle 11G? I mean Does hibernatespatial support major spatial api in oracle? Thanks Gelin Yan _______________________________________________ hibernatespatial-users mailing list [hidden email] http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users |
||||||||||||||||
|
Karel Maesen
|
Hi,
On 30 Mar 2009, at 05:48, Dfgqq Dfgqq wrote: > Hi All > > I am a newcomer of hibernatespatial. Currently we have a > GIS project (the backend db is oracle 11g). I want to konw two things: > > 1 Did anyone use hibernatespatial for large-scale application before? I use Hibernate Spatial in several applications that would rate medium-scale. But then, as the main HS developer I would. A well-documented example is the RMI-SAFIR application: http:// www.osgeo.org/ocs/index.php/foss4g/2008/paper/view/340/196 > > > 2 How well does hibernatespatial work with oracle 11G? I mean Does > hibernatespatial support major spatial api in oracle? > Oracle 11g should work as long as you use SDO_Geometry. The SQL/MM dialect will be supported in a later stage. Regards, Karel Maesen _______________________________________________ hibernatespatial-users mailing list [hidden email] http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users |
||||||||||||||||
|
pachkulja
|
Hello everybody,
We have being playing with hibernate-spatial-oracle-1.0-M2 dialect for a while now. We have an EJB 3.0 test app running inside JBoss 5.0 with Oracle 10g which uses JPA and does CRUD . We hit on the SOAP web service exercising CRUD test from JMeter from multiple threads (users). When we do that using Oracle thin driver everything seems to work just fine. However when we use Oracle OCI driver we often get the exception attached below. Any ideas why that might be happening? If you read the manual from Oracle (http://download.oracle.com/docs/cd/B12037_01/java.101/b10979/oraoot.htm) you can see that the driver caches an reuses StructDescriptor for each connection. Accordingly we removed caching of structDescriptor in SDO_GEOMETRY class in SDOGeometryType.java and modified store method as follows: public static STRUCT store(SDO_GEOMETRY geom, Connection conn) throws SQLException { // if (structDescriptor == null) { // structDescriptor = StructDescriptor.createDescriptor(TYPE_NAME, // conn); // } else { // structDescriptor.setConnection(conn); // } StructDescriptor structDescriptor = StructDescriptor.createDescriptor(TYPE_NAME, conn); Datum[] attributes = new Datum[5]; attributes[0] = new NUMBER(geom.getGType().intValue()); if (geom.getSRID() > 0) { attributes[1] = new NUMBER(geom.getSRID()); } else { attributes[1] = null; } attributes[3] = geom.getInfo().toOracleArray(conn); attributes[4] = geom.getOrdinates().toOracleArray(conn); return new STRUCT(structDescriptor, conn, attributes); } Unfortunately this change didn't fix the problem completely as we still see the exception once in a while. Thanks for the help, Pachkulja PS. Sorry for posting to this thread, but I couldn't create a new one. javax.persistence.PersistenceException: org.hibernatespatial.HibernateSpatialException: Problem during conversion from JTS to JGeometry at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:516) at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:101) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:263) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86) at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1414) at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135) at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75) at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:170) at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87) at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:487) at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:85) at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62) at $Proxy153.invoke(Unknown Source) at org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261) at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101) at $Proxy135.create(Unknown Source) at com.metria.vn.dos.service.TestBusinessObjectBean.crud(TestBusinessObjectBean.java:63) at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69) at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73) at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59) at sun.reflect.GeneratedMethodAccessor265.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72) at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_26707741.invoke(InvocationContextInterceptor_z_fillMethod_26707741.java) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88) at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_26707741.invoke(InvocationContextInterceptor_z_setup_26707741.java) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66) at org.jboss.ejb3.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:114) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:372) at org.jboss.ejb3.stateless.StatelessContainer.invokeEndpoint(StatelessContainer.java:727) at org.jboss.wsf.container.jboss50.invocation.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:96) at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:219) at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:474) at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295) at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205) at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131) at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) Caused by: org.hibernatespatial.HibernateSpatialException: Problem during conversion from JTS to JGeometry at org.hibernatespatial.oracle.SDOGeometryType.conv2DBGeometry(SDOGeometryType.java:99) at org.hibernatespatial.oracle.SDOGeometryType.nullSafeSet(SDOGeometryType.java:86) at org.hibernatespatial.GeometryUserType.nullSafeSet(GeometryUserType.java:184) at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:169) at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2025) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2271) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2688) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365) at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504) ... 111 more Caused by: java.sql.SQLException: Internal Error: Cannot construct ARRAY instance,invalid connection at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:197) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:269) at oracle.sql.ARRAY.<init>(ARRAY.java:87) at org.hibernatespatial.oracle.SDOGeometryType$ELEM_INFO.toOracleArray(SDOGeometryType.java:1242) at org.hibernatespatial.oracle.SDOGeometryType$SDO_GEOMETRY.store(SDOGeometryType.java:1453) at org.hibernatespatial.oracle.SDOGeometryType.conv2DBGeometry(SDOGeometryType.java:97) ... 126 more |
||||
|
Karel Maesen
|
Hi,
Might this be the same issue as in this post: http:// forums.oracle.com/forums/thread.jspa?threadID=378572. It might be that this issue is a thread-safety issue, related to the caching of the descriptors. That would explain why the occurrence of the exception diminished after your modification. But you should also have removed the caching in the inner static classes: ELEM_INFO and ORDINATES (they use the same technique as SDO_GEOMETRY). Could you try that and let us know the result? In the mean time I'll create an issue in JIRA for this problem. Regards, Karel Maesen On 20 Apr 2009, at 21:02, pachkulja wrote: > Hello everybody, > > We have being playing with hibernate-spatial-oracle-1.0-M2 dialect > for a > while now. We have an EJB 3.0 test app running inside JBoss 5.0 > with Oracle > 10g which uses JPA and does CRUD . We hit on the SOAP web service > exercising > CRUD test from JMeter from multiple threads (users). When we do > that using > Oracle thin driver everything seems to work just fine. However when > we use > Oracle OCI driver we often get the exception attached below. Any > ideas why > that might be happening? > > If you read the manual from Oracle > (http://download.oracle.com/docs/cd/B12037_01/java.101/b10979/ > oraoot.htm) > you can see that the driver caches an reuses StructDescriptor for each > connection. > Accordingly we removed caching of structDescriptor in SDO_GEOMETRY > class in > SDOGeometryType.java and modified store method as follows: > > public static STRUCT store(SDO_GEOMETRY geom, Connection conn) > throws SQLException { > > // if (structDescriptor == null) { > // structDescriptor = StructDescriptor.createDescriptor(TYPE_NAME, > // conn); > // } else { > // structDescriptor.setConnection(conn); > // } > > StructDescriptor structDescriptor = > StructDescriptor.createDescriptor(TYPE_NAME, conn); > > Datum[] attributes = new Datum[5]; > attributes[0] = new NUMBER(geom.getGType().intValue()); > if (geom.getSRID() > 0) { > attributes[1] = new NUMBER(geom.getSRID()); > } else { > attributes[1] = null; > } > attributes[3] = geom.getInfo().toOracleArray(conn); > attributes[4] = geom.getOrdinates().toOracleArray(conn); > return new STRUCT(structDescriptor, conn, attributes); > > } > > Unfortunately this change didn't fix the problem completely as we > still see > the exception once in a while. > > Thanks for the help, > > Pachkulja > > PS. Sorry for posting to this thread, but I couldn't create a new one. > _______________________________________________ hibernatespatial-users mailing list [hidden email] http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users |
||||||||||||||||
|
pachkulja
|
Hi Karel,
>Might this be the same issue as in this post: http:// >forums.oracle.com/forums/thread.jspa?threadID=378572. > >It might be that this issue is a thread-safety issue, related to the >caching of the descriptors. That would explain why the occurrence of >the exception diminished after your modification. But you should also >have removed the caching in the inner static classes: ELEM_INFO and >ORDINATES (they use the same technique as SDO_GEOMETRY). Could you >try that and let us know the result? I have made the changes that you suggested. It appears that the changes fixed the problem. Now everything seems to work just fine. I attached the file I modified (SDOGeometryType.java) Thanks for the help, Pachkulja _______________________________________________ hibernatespatial-users mailing list hibernatespatial-users@lists.hibernatespatial.org http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users SDOGeometryType.java |
||||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |