Re: hibernatespatial-users Digest, Vol 12, Issue 1

2 messages Options
Embed this post
Permalink
Coquelicot-2

Re: hibernatespatial-users Digest, Vol 12, Issue 1

Reply Threaded More More options
Print post
Permalink
>
> Hi,
>
> You should do something like this:
>
>
>        //create your query
>        Query q = session.createQuery(< your hql > );
>        Geometry geom = < your parameter value>
>        //now first create a custom type
>        Type geometryType = new CustomType(GeometryUserType.class, null);
>        q.setParameter(:geoExp0, geom, geometryType);
>
> You need to pass by CustomType because internally Hibernate can't
> figure out what Hibernate Type to use for Geometry objects.
>
> Regards
>
> Karel Maesen
>

Karl,

thanks for help - the problem was somewhere else: I was using Oracle
9i and not 10g. It seems that Hibernate Spatial only works for 10g. It
gives us another reason to frop the support for Oracle 0 :).

Another question: I had problems with using C3P0 connection pooling
with Hibernate Spatial - is it supported at all?

greetings, and have a good weekend,
--
Lukasz
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Karel Maesen

Re: hibernatespatial-users Digest, Vol 12, Issue 1

Reply Threaded More More options
Print post
Permalink
Hi,

It's currently not supported. The problem with C3PO is that it wraps  
the JDBC Connection object. Unfortunately, for converting  
SDO_GEOMETRY objects we need the "original" OracleConnection object.

Currently Hibernate Spatial implements a simple strategy to  
successively unwrap the Connection object until it finds the  
OracleConnection object. This strategy fails in the case of C3P0. See  
the discussion at:

http://www.nabble.com/Re%3A-C3P0-Connection-pool-support-to15181513.html

I'm in the process of adding a "ConnectionFinder" interface. Client-
provided implemenations of this interface should return an  
OracleConnection when given the current Connection.

See also:  http://docs.codehaus.org/display/GEOTOOLS/J2EE+and 
+Connection+Pools.

Regards,

Karel Maesen

On 08 Aug 2008, at 17:06, Coquelicot wrote:
>
> Another question: I had problems with using C3P0 connection pooling
> with Hibernate Spatial - is it supported at all?
>
>
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users