Inserting null geometries into Oracle database

2 messages Options
Embed this post
Permalink
Bas Couwenberg

Inserting null geometries into Oracle database

Reply Threaded More More options
Print post
Permalink
Hello,
 
is it possible to insert null geometries into a Oracle database? When I do this I get a invalid name exception and the geometrye type SDO_GEOMETRY is changed to AGE.SDO_GEOMETRY. I looked at the SDOGeometryType and OracleSpatial10gDialect and I saw that the types there are defined by "SDO_GEOMETRY", why aren't they like "MDSYS.SDO_GEOMETRY"? Because I changed them and it seemed to work for now. The AGE prefix is the database user I am using.
 
Regards,
 
Bas Couwenberg
 
 

Caused by: java.sql.SQLException: Ongeldig naampatroon.: AGE.SDO_GEOMETRY
99         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
100         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
101         at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:412)
102         at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:327)
103         at oracle.sql.StructDescriptor.initPickler(StructDescriptor.java:206)
104         at oracle.sql.StructDescriptor.<init>(StructDescriptor.java:179)
105         at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:142)
106         at oracle.jdbc.driver.OraclePreparedStatement.setNullCritial(OraclePreparedStatement.java:3723)
107         at oracle.jdbc.driver.OraclePreparedStatement.setNullInternal(OraclePreparedStatement.java:3692)
108         at oracle.jdbc.driver.OraclePreparedStatement.setNull(OraclePreparedStatement.java:3669)
109         at oracle.oc4j.sql.proxy.PreparedStatementBCELProxy.setNull(PreparedStatementBCELProxy.java:470)
110         at org.hibernatespatial.oracle.SDOGeometryType.nullSafeSet(SDOGeometryType.java:84)
111         at org.hibernatespatial.GeometryUserType.nullSafeSet(GeometryUserType.java:184)
112         at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:146)
113         at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1997)
114         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2371)
115         at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
116         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
117         at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
118         at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
119         at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
120         at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
121         at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
122         at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
123         at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
124         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
125         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
126         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
127         at java.lang.reflect.Method.invoke(Method.java:585)
128         at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1202)
129         at $Proxy345.flush(Unknown Source)
130         at nl.gouwit.data.core.hibernate.DataAccessObjectImpl$10.doInHibernate(Unknown Source)
131         at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
132         ... 86 more

_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Karel Maesen

Re: Inserting null geometries into Oracle database

Reply Threaded More More options
Print post
Permalink
Hi Bas,

Looks like I neglected to add the schema name to the type declaration  
in some places.  I'll correct the code. And yes, it should be  
possible to insert null geometries.

Regards,

Karel

On 29 Feb 2008, at 11:08, Bas Couwenberg wrote:

> Hello,
>
> is it possible to insert null geometries into a Oracle database?  
> When I do this I get a invalid name exception and the geometrye  
> type SDO_GEOMETRY is changed to AGE.SDO_GEOMETRY. I looked at the  
> SDOGeometryType and OracleSpatial10gDialect and I saw that the  
> types there are defined by "SDO_GEOMETRY", why aren't they like  
> "MDSYS.SDO_GEOMETRY"? Because I changed them and it seemed to work  
> for now. The AGE prefix is the database user I am using.
>
> Regards,
>
> Bas Couwenberg
>
>  <trace.txt>_______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/ 
> hibernatespatial-users

_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users