Problem during conversion from JTS to JGeometry

7 messages Options
Embed this post
Permalink
Bas Couwenberg

Problem during conversion from JTS to JGeometry

Reply Threaded More More options
Print post
Permalink
Hello,
 
first of all I want to say that hibernatespatial is a great project which saved me alot of work and problems during development of my webapplication.
During this development process I always tested my application on an Tomcat webserver which works perfect. Now recently I've been trying to deploy the application on a Oracle Application Server and I get the stacktrace below. Do you know if this has something to do with the jdbc drivers or are there known issues with Oracle Application Server? I use the following versions:
 
Tomcat 5.0.28
Oracle Application Server 10.1.3.1.0
hibernate-spatial-1.0-M1.jar
hibernate-spatial-oracle-1.0-M1.jar
 

17:08:53,875 ERROR FoutBean:? - Unexpected error:
org.hibernatespatial.HibernateSpatialException: Problem during conversion from JTS to JGeometry
 at org.hibernatespatial.oracle.SDOGeometryType.conv2DBGeometry(SDOGeometryType.java:103)
 at org.hibernatespatial.oracle.SDOGeometryType.nullSafeSet(SDOGeometryType.java:90)
 at org.hibernatespatial.GeometryUserType.nullSafeSet(GeometryUserType.java:183)
 at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:156)
 at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1707)
 at org.hibernate.loader.Loader.bindParameterValues(Loader.java:1678)
 at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1563)
 at org.hibernate.loader.Loader.doQuery(Loader.java:673)
 at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
 at org.hibernate.loader.Loader.doList(Loader.java:2220)
 at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
 at org.hibernate.loader.Loader.list(Loader.java:2099)
 at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
 at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
 at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
 at x

 at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
 at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
 at x

 at x

 at x

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
 at x

 at x

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
 at x
 at x

 at x

 at com.luciad.ogc.wfs.u.a(Unknown Source)
 at com.luciad.ogc.wfs.u.a(Unknown Source)
 at com.luciad.ogc.wfs.n.a(Unknown Source)
 at com.luciad.ogc.common.e.a(Unknown Source)
 at com.luciad.ogc.wfs.TLcdWFSServlet.doGet(Unknown Source)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
 at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
 at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108)
 at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197)
 at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
 at net.sf.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:143)
 at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
 at net.sf.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:214)
 at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
 at net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:324)
 at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
 at net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)
 at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
 at net.sf.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
 at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
 at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:619)
 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
 at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302)
 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190)
 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
 at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Maken van descriptor is mislukt.: Invalid arguments
 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
 at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:155)
 at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:130)
 at org.hibernatespatial.oracle.SDOGeometryType$SDO_GEOMETRY.store(SDOGeometryType.java:1443)
 at org.hibernatespatial.oracle.SDOGeometryType.conv2DBGeometry(SDOGeometryType.java:101)
 ... 74 more
08/02/19 17:08:53 org.hibernatespatial.HibernateSpatialException: Problem during conversion from JTS to JGeometry
08/02/19 17:08:53 java.sql.SQLException: Maken van descriptor is mislukt.: Invalid arguments


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

Re: Problem during conversion from JTS to JGeometry

Reply Threaded More More options
Print post
Permalink
Hi Bas,


On 20 Feb 2008, at 09:10, Bas Couwenberg wrote:
>
> first of all I want to say that hibernatespatial is a great project  
> which saved me alot of work and problems during development of my  
> webapplication.

It's always nice to hear from a satisfied user.

> During this development process I always tested my application on  
> an Tomcat webserver which works perfect. Now recently I've been  
> trying to deploy the application on a Oracle Application Server and  
> I get the stacktrace below. Do you know if this has something to do  
> with the jdbc drivers or are there known issues with Oracle  
> Application Server? I use the following versions:
>
> Tomcat 5.0.28
> Oracle Application Server 10.1.3.1.0
> hibernate-spatial-1.0-M1.jar
> hibernate-spatial-oracle-1.0-M1.jar
>


It looks like you have a problem with the JDBC driver. An exception  
is thrown when Hibernate Spatial tries to create an Oracle STRUCT  
object.  Apparently one of the arguments is invalid. You are  
connecting to the same database as when you use Tomcat?

The following code snippet would recreate the problem and only  
depends on using Oracle JDBC. You might try to run this code and use  
it to further diagnose the problem.

...
OracleConnection conn = ...
StructDescriptor descr = StructDescriptor.createDescriptor
("MDSYS.SDO_ELEM_INFO_ARRAY", conn);
...

I haven't heard of any specific problems with Oracle AS. My advice is  
to ensure that you use the exact same JDBC driver in Oracle AS as you  
used in Tomcat.

Regards,

Karel Maesen

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

Re: Problem during conversion from JTS to JGeometry

Reply Threaded More More options
Print post
Permalink
Hello,
 
after some further investigation I discovered that the method findOracleConnection in the class SDOGeometryType returns NULL when using OAS. This because the method gets a Connection of the type oracle_jdbc_driver_LogicalConnection_Proxy (with Tomcat I get a org.apache.commons.dbcp.PoolableConnection) and it can't get the internal connection or a connection of type OracleConnection. When I remove all of the casts which are performed with the connection variable, that is retrieved with PreparedStatement.getConnection(), such as: (OracleConnection) connection and use the Connection class in the methods instead of OracleConnection it works with OAS. But now I changed this hard coded and removed the recursive function in the method findOracleConnection which I think is needed for other application servers. Can you give me advice about how to deal with this problem?
 
Regards,
 
Bas Couwenberg
 
 
On Wed, Feb 20, 2008 at 10:06 PM, Karel Maesen <[hidden email]> wrote:
Hi Bas,


On 20 Feb 2008, at 09:10, Bas Couwenberg wrote:
>
> first of all I want to say that hibernatespatial is a great project
> which saved me alot of work and problems during development of my
> webapplication.

It's always nice to hear from a satisfied user.

> During this development process I always tested my application on
> an Tomcat webserver which works perfect. Now recently I've been
> trying to deploy the application on a Oracle Application Server and
> I get the stacktrace below. Do you know if this has something to do
> with the jdbc drivers or are there known issues with Oracle
> Application Server? I use the following versions:
>
> Tomcat 5.0.28
> Oracle Application Server 10.1.3.1.0
> hibernate-spatial-1.0-M1.jar
> hibernate-spatial-oracle-1.0-M1.jar
>


It looks like you have a problem with the JDBC driver. An exception
is thrown when Hibernate Spatial tries to create an Oracle STRUCT
object.  Apparently one of the arguments is invalid. You are
connecting to the same database as when you use Tomcat?

The following code snippet would recreate the problem and only
depends on using Oracle JDBC. You might try to run this code and use
it to further diagnose the problem.

...
OracleConnection conn = ...
StructDescriptor descr = StructDescriptor.createDescriptor
("MDSYS.SDO_ELEM_INFO_ARRAY", conn);
...

I haven't heard of any specific problems with Oracle AS. My advice is
to ensure that you use the exact same JDBC driver in Oracle AS as you
used in Tomcat.

Regards,

Karel Maesen

_______________________________________________
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
Karel Maesen

Re: Problem during conversion from JTS to JGeometry

Reply Threaded More More options
Print post
Permalink
Hi Bas,

Could you create a patch so I can see the changes you made to get to  
work? Could you also check whether this  
oracle_jdbc_driver_LogicalConnection_Proxy  is a genuine dynamic  
proxy (i.e. if  java.lang.reflect.Proxy.isProxyClass
(oracle_jdbc_driver_LogicalConnection_Proxy.class) return true)?

This issue keeps cropping up with Oracle. To create an Oracle  
SDO_GEOMETRY we need an Oracle STRUCT instance, which can only be  
created when you have an OracleConnection object. Unfortunately, in a  
managed environment the Connection objects are usually wrapped or  
proxied and not directly available.  This is why we have the  
findOracleConnection function, but that clearly cannot handle all  
cases. See the discussion on this list related to C3P0, where the  
same problems occur.

In that discussion I proposed to break out the findOracleConnection  
function in a seperate class so that the strategy of getting an  
appropriate Connection can be override depending on the environment.  
If you send me that patch, it will help me to create an appropriate  
interface. In any case, I will change the code so that the finder  
does not return a null object.

Regards,

Karel Maesen



On 22 Feb 2008, at 12:21, Bas Couwenberg wrote:

> Hello,
>
> after some further investigation I discovered that the method  
> findOracleConnection in the class SDOGeometryType returns NULL when  
> using OAS. This because the method gets a Connection of the type  
> oracle_jdbc_driver_LogicalConnection_Proxy (with Tomcat I get a  
> org.apache.commons.dbcp.PoolableConnection) and it can't get the  
> internal connection or a connection of type OracleConnection. When  
> I remove all of the casts which are performed with the connection  
> variable, that is retrieved with PreparedStatement.getConnection(),  
> such as: (OracleConnection) connection and use the Connection class  
> in the methods instead of OracleConnection it works with OAS. But  
> now I changed this hard coded and removed the recursive function in  
> the method findOracleConnection which I think is needed for other  
> application servers. Can you give me advice about how to deal with  
> this problem?
>
> Regards,
>
> Bas Couwenberg
>
>
> On Wed, Feb 20, 2008 at 10:06 PM, Karel Maesen <[hidden email]>  
> wrote:
> Hi Bas,
>
>
> On 20 Feb 2008, at 09:10, Bas Couwenberg wrote:
> >
> > first of all I want to say that hibernatespatial is a great project
> > which saved me alot of work and problems during development of my
> > webapplication.
>
> It's always nice to hear from a satisfied user.
>
> > During this development process I always tested my application on
> > an Tomcat webserver which works perfect. Now recently I've been
> > trying to deploy the application on a Oracle Application Server and
> > I get the stacktrace below. Do you know if this has something to do
> > with the jdbc drivers or are there known issues with Oracle
> > Application Server? I use the following versions:
> >
> > Tomcat 5.0.28
> > Oracle Application Server 10.1.3.1.0
> > hibernate-spatial-1.0-M1.jar
> > hibernate-spatial-oracle-1.0-M1.jar
> >
>
>
> It looks like you have a problem with the JDBC driver. An exception
> is thrown when Hibernate Spatial tries to create an Oracle STRUCT
> object.  Apparently one of the arguments is invalid. You are
> connecting to the same database as when you use Tomcat?
>
> The following code snippet would recreate the problem and only
> depends on using Oracle JDBC. You might try to run this code and use
> it to further diagnose the problem.
>
> ...
> OracleConnection conn = ...
> StructDescriptor descr = StructDescriptor.createDescriptor
> ("MDSYS.SDO_ELEM_INFO_ARRAY", conn);
> ...
>
> I haven't heard of any specific problems with Oracle AS. My advice is
> to ensure that you use the exact same JDBC driver in Oracle AS as you
> used in Tomcat.
>
> Regards,
>
> Karel Maesen
>
> _______________________________________________
> 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

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

Re: Problem during conversion from JTS to JGeometry

Reply Threaded More More options
Print post
Permalink
Hello,
 
sorry for the long wait but I was talking about the issue with Oracle too. They haven't given me a proper solution yet for the proxy object so I made some changes to the SDOGeometryType.java to see if it solves  my problem. The isProxyClass method returned false with the proxy object. But it seems that by directly returning the proxy object to the StructDescriptor, the STRUCT is created correctly. I don't think the changes I made are a good solution but it worked for me on JBoss, Tomcat and OAS which is important because we need to support all these servers.
Could you tell me if the license of the project permits me of changing and building  the library for our application? I really need this feature because of a major release of our application coming up in which it must be deployed on OAS. The changes I made are in the attachment as a patch.
 
Greetings,
 
Bas Couwenberg
On Fri, Feb 22, 2008 at 1:14 PM, Karel Maesen <[hidden email]> wrote:
Hi Bas,

Could you create a patch so I can see the changes you made to get to
work? Could you also check whether this
oracle_jdbc_driver_LogicalConnection_Proxy  is a genuine dynamic
proxy (i.e. if  java.lang.reflect.Proxy.isProxyClass
(oracle_jdbc_driver_LogicalConnection_Proxy.class) return true)?

This issue keeps cropping up with Oracle. To create an Oracle
SDO_GEOMETRY we need an Oracle STRUCT instance, which can only be
created when you have an OracleConnection object. Unfortunately, in a
managed environment the Connection objects are usually wrapped or
proxied and not directly available.  This is why we have the
findOracleConnection function, but that clearly cannot handle all
cases. See the discussion on this list related to C3P0, where the
same problems occur.

In that discussion I proposed to break out the findOracleConnection
function in a seperate class so that the strategy of getting an
appropriate Connection can be override depending on the environment.
If you send me that patch, it will help me to create an appropriate
interface. In any case, I will change the code so that the finder
does not return a null object.

Regards,

Karel Maesen



On 22 Feb 2008, at 12:21, Bas Couwenberg wrote:

> Hello,
>
> after some further investigation I discovered that the method
> findOracleConnection in the class SDOGeometryType returns NULL when
> using OAS. This because the method gets a Connection of the type
> oracle_jdbc_driver_LogicalConnection_Proxy (with Tomcat I get a
> org.apache.commons.dbcp.PoolableConnection) and it can't get the
> internal connection or a connection of type OracleConnection. When
> I remove all of the casts which are performed with the connection
> variable, that is retrieved with PreparedStatement.getConnection(),
> such as: (OracleConnection) connection and use the Connection class
> in the methods instead of OracleConnection it works with OAS. But
> now I changed this hard coded and removed the recursive function in
> the method findOracleConnection which I think is needed for other
> application servers. Can you give me advice about how to deal with
> this problem?
>
> Regards,
>
> Bas Couwenberg
>
>
> On Wed, Feb 20, 2008 at 10:06 PM, Karel Maesen <[hidden email]>
> wrote:
> Hi Bas,
>
>
> On 20 Feb 2008, at 09:10, Bas Couwenberg wrote:
> >
> > first of all I want to say that hibernatespatial is a great project
> > which saved me alot of work and problems during development of my
> > webapplication.
>
> It's always nice to hear from a satisfied user.
>
> > During this development process I always tested my application on
> > an Tomcat webserver which works perfect. Now recently I've been
> > trying to deploy the application on a Oracle Application Server and
> > I get the stacktrace below. Do you know if this has something to do
> > with the jdbc drivers or are there known issues with Oracle
> > Application Server? I use the following versions:
> >
> > Tomcat 5.0.28
> > Oracle Application Server 10.1.3.1.0
> > hibernate-spatial-1.0-M1.jar
> > hibernate-spatial-oracle-1.0-M1.jar
> >
>
>
> It looks like you have a problem with the JDBC driver. An exception
> is thrown when Hibernate Spatial tries to create an Oracle STRUCT
> object.  Apparently one of the arguments is invalid. You are
> connecting to the same database as when you use Tomcat?
>
> The following code snippet would recreate the problem and only
> depends on using Oracle JDBC. You might try to run this code and use
> it to further diagnose the problem.
>
> ...
> OracleConnection conn = ...
> StructDescriptor descr = StructDescriptor.createDescriptor
> ("MDSYS.SDO_ELEM_INFO_ARRAY", conn);
> ...
>
> I haven't heard of any specific problems with Oracle AS. My advice is
> to ensure that you use the exact same JDBC driver in Oracle AS as you
> used in Tomcat.
>
> Regards,
>
> Karel Maesen
>
> _______________________________________________
> 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

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


Index: src/main/java/org/hibernatespatial/oracle/SDOGeometryType.java
===================================================================
--- src/main/java/org/hibernatespatial/oracle/SDOGeometryType.java (revision 92)
+++ src/main/java/org/hibernatespatial/oracle/SDOGeometryType.java (working copy)
@@ -95,7 +95,7 @@
  SDO_GEOMETRY geom = convertJTSGeometry(jtsGeom);
  if (geom != null)
  try {
- return SDO_GEOMETRY.store(geom, (OracleConnection) connection);
+ return SDO_GEOMETRY.store(geom, connection);
  } catch (SQLException e) {
  throw new HibernateSpatialException(
  "Problem during conversion from JTS to JGeometry", e);
@@ -154,22 +154,28 @@
  * @param con
  * @return
  */
- private OracleConnection findOracleConnection(Connection con) {
+ private Connection findOracleConnection(Connection con) {
  if (con == null) {
  return null;
  }
  if (con instanceof OracleConnection) {
  return (OracleConnection) con;
  }
+
  // try to find the Oracleconnection recursively
-
+
  for (Method method : con.getClass().getMethods()) {
  if (method.getReturnType().isAssignableFrom(
  java.sql.Connection.class)
  && method.getParameterTypes().length == 0) {
  try {
- return findOracleConnection((java.sql.Connection) (method
- .invoke(con, new Object[] {})));
+ Connection unwrappedCon = (java.sql.Connection) (method.invoke(con, new Object[] {}));
+ if(unwrappedCon == null) {
+ return con;
+ }
+ else {
+ return findOracleConnection(unwrappedCon);
+ }
  } catch (Exception e) {
  // Shouldm't ever happen.
  }
@@ -1232,7 +1238,7 @@
  return ea;
  }
 
- public ARRAY toOracleArray(OracleConnection conn) throws SQLException {
+ public ARRAY toOracleArray(Connection conn) throws SQLException {
 
  if (arrayDescriptor == null) {
  arrayDescriptor = ArrayDescriptor.createDescriptor(TYPE_NAME,
@@ -1304,7 +1310,7 @@
  this.ordinates = newOrdinates;
  }
 
- public ARRAY toOracleArray(OracleConnection conn) throws SQLException {
+ public ARRAY toOracleArray(Connection conn) throws SQLException {
  if (arrayDescriptor == null) {
  arrayDescriptor = ArrayDescriptor.createDescriptor(TYPE_NAME,
  conn);
@@ -1433,7 +1439,7 @@
  return geom;
  }
 
- public static STRUCT store(SDO_GEOMETRY geom, OracleConnection conn)
+ public static STRUCT store(SDO_GEOMETRY geom, Connection conn)
  throws SQLException {
 
  if (structDescriptor == null) {

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

Re: Problem during conversion from JTS to JGeometry

Reply Threaded More More options
Print post
Permalink
Hi,

On 26 Feb 2008, at 10:41, Bas Couwenberg wrote:

> sorry for the long wait but I was talking about the issue with  
> Oracle too. They haven't given me a proper solution yet for the  
> proxy object so I made some changes to the SDOGeometryType.java to  
> see if it solves  my problem. The isProxyClass method returned  
> false with the proxy object. But it seems that by directly  
> returning the proxy object to the StructDescriptor, the STRUCT is  
> created correctly.

If Oracle gets back to you with some information, I'd appreciate it  
if you share this with me.

> I don't think the changes I made are a good solution but it worked  
> for me on JBoss, Tomcat and OAS which is important because we need  
> to support all these servers.
> Could you tell me if the license of the project permits me of  
> changing and building  the library for our application? I really  
> need this feature because of a major release of our application  
> coming up in which it must be deployed on OAS. The changes I made  
> are in the attachment as a patch.

The library is licensed under LGPL, v2.1. As with most open-source  
licenses, you are free to modify the source without restrictions or  
conditions as long as you don't re-distribute the modified library.  
I guess that this is the case here. If you do distribute the modified  
library (e.g. when you sell copies of your application), you must  
comply with the conditions of the LGPL, esp. art. 2  (see: http://
www.gnu.org/licenses/old-licenses/lgpl-2.1.html).

Thanks for the patch. It will help me improve the Oracle Provider.

Regards,

Karel Maesen

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

Re: Problem during conversion from JTS to JGeometry

Reply Threaded More More options
Print post
Permalink
Hi,

I am using hibernate-spatial-oracle-1.0-M2.jar not M1 that this post mentions and I am still getting this issue, having looked at the code in SDOGeometryType there is now only one mention of OracleConnection so changes have been made since the patch in this post was mentioned.

Does anyone have any work arounds for this?

Thanks in advance.

Phil Maskell

Karel Maesen wrote:
Hi,

On 26 Feb 2008, at 10:41, Bas Couwenberg wrote:

> sorry for the long wait but I was talking about the issue with  
> Oracle too. They haven't given me a proper solution yet for the  
> proxy object so I made some changes to the SDOGeometryType.java to  
> see if it solves  my problem. The isProxyClass method returned  
> false with the proxy object. But it seems that by directly  
> returning the proxy object to the StructDescriptor, the STRUCT is  
> created correctly.

If Oracle gets back to you with some information, I'd appreciate it  
if you share this with me.

> I don't think the changes I made are a good solution but it worked  
> for me on JBoss, Tomcat and OAS which is important because we need  
> to support all these servers.
> Could you tell me if the license of the project permits me of  
> changing and building  the library for our application? I really  
> need this feature because of a major release of our application  
> coming up in which it must be deployed on OAS. The changes I made  
> are in the attachment as a patch.

The library is licensed under LGPL, v2.1. As with most open-source  
licenses, you are free to modify the source without restrictions or  
conditions as long as you don't re-distribute the modified library.  
I guess that this is the case here. If you do distribute the modified  
library (e.g. when you sell copies of your application), you must  
comply with the conditions of the LGPL, esp. art. 2  (see: http://
www.gnu.org/licenses/old-licenses/lgpl-2.1.html).

Thanks for the patch. It will help me improve the Oracle Provider.

Regards,

Karel Maesen

_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@lists.hibernatespatial.org
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users