Q:

Eclipselink: Custom StructConverter for Spatial never called

I've ran into a problem concerning complex objects and Eclipselink which I can't seem to solve. I need to write / read spatial data as SDO_GEOMETRY to my Oracle database.
I used to use oracle.spatial.geometry.JGeometry, but for querying reasons I need to switch to org.geolatte.geom.Geometry (which is the spatial type used by QueryDSL). So I wrote a custom implementation of org.eclipse.persistence.platform.database.converters.StructConverter to handle the conversion from org.geolatte.geom.Geometry to SDO_GEOMETRY / Struct.
I used org.eclipse.persistence.platform.database.oracle.converters.JGeometryConverter as a template.
import com.mysema.query.sql.spatial.JGeometryConverter;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Struct;
import oracle.spatial.geometry.JGeometry;
import org.eclipse.persistence.platform.database.converters.StructConverter;
import org.geolatte.geom.Geometry;

public class GeometryConverter implements StructConverter {
    private static final String JGEOMETRY_DB_TYPE = "MDSYS.SDO_GEOMETRY";
    private Class JGEOMETRY_CLASS;
    private MethodHandle loadJSMethod;
    private MethodHandle storeJSMethod;

    public GeometryConverter() {
        try {
            JGEOMETRY_CLASS = Class.forName("oracle.spatial.geometry.JGeometry");
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }

        MethodHandles.Lookup lookup = MethodHandles.lookup();
        try {
            loadJSMethod = lookup.unreflect(JGEOMETRY_CLASS.getMethod("loadJS", new Class[] {
                Struct.class
            }));
            storeJSMethod = lookup.unreflect(JGEOMETRY_CLASS.getMethod("storeJS", new Class[] {
                JGEOMETRY_CLASS,
                Connection.class
            }));
        } catch (IllegalAccessException | NoSuchMethodException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public String getStructName() {
        return JGEOMETRY_DB_TYPE;
    }

    @Override
    public Class getJavaType() {
        return Geometry.class;
    }

    @Override
    public Object convertToObject(Struct struct) throws SQLException {
        System.out.println("-------------------- CALLED convertToObject");
        if (struct == null) {
            return null;
        }
        try {
            return JGeometryConverter.convert((JGeometry)loadJSMethod.invokeWithArguments(new Object[] {
                struct
            }));

        } catch (Throwable throwable) {
            throw new SQLException(throwable);
        }
    }

    @Override
    public Struct convertToStruct(Object geometry, Connection connection) throws SQLException {
        System.out.println("-------------------- CALLED convertToStruct");
        if (geometry == null) {
            return null;
        }
        try {
            return (Struct) storeJSMethod.invokeWithArguments(new Object[] {
                JGeometryConverter.convert((Geometry)geometry), connection
            });
        } catch (Throwable throwable) {
            throw new SQLException(throwable);
        }
    }
}

My entity class is annotated the following way:
//Real package replaced by 'myPkg' for privacy reasons
@StructConverter(name = "Geometry", converter = "myPkg.GeometryConverter")
@Table(name = "ENTRY", catalog = "")
public class Entry implements Serializable {
    ...

    @Column(name = "LOCATION")
    @Convert("Geometry")
    private Geometry location;
    ...
}

But for some odd reason the method convertToStruct of my converter is not called when calling entityManager.persist(myEntryObject).
Instead I get the following exception:
Caused by: java.sql.SQLException: Invalid column type
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:8488)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7995)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8735)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8714)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:219)
    at org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.setParameterValueInDatabaseCall(DatabasePlatform.java:2506)
    at org.eclipse.persistence.platform.database.oracle.Oracle9Platform.setParameterValueInDatabaseCall(Oracle9Platform.java:525)
    at org.eclipse.persistence.internal.databaseaccess.BindCallCustomParameter.set(BindCallCustomParameter.java:69)
    at org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.setParameterValueInDatabaseCall(DatabasePlatform.java:2500)
    at org.eclipse.persistence.platform.database.oracle.Oracle9Platform.setParameterValueInDatabaseCall(Oracle9Platform.java:525)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:797)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:621)
    ... 101 more

What is so odd about this is that when retrieving Entry objects via the EntityManager convertToObject is indeed called and it works perfectly. But every time I try to insert / update an Entry it doesn't work.
Is there any additional configuration I have to do to make EclipseLink recognize my converter? What else could be the cause of this problem?
I hope someone can help me. Thank you in advance.
EDIT
My persistence unit looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_1_0.xsd">
  <persistence-unit name="jtaUnit" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>java:app/aphrodite4</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
        <property name="toplink.target-database" value ="oracle.toplink.essentials.extension.spatial.Oracle10SpatialPlatform"/>
        <property name="eclipselink.cache.shared.default" value="false"/>
        <property name="javax.persistence.validation.group.pre-persist" value="javax.validation.groups.Default"/>
        <property name="javax.persistence.validation.group.pre-update" value="javax.validation.groups.Default,myPkg.ConstraintGroups.Update"/>
    </properties>
  </persistence-unit>
</persistence>

I am loading it the following way:
@PersistenceContext(unitName = "jtaUnit")
protected EntityManager em;

A:

After not finding a solution to the problem mentioned above I was able to work out a workaround.
I wrote the following Database Function:
create or replace FUNCTION WITHIN_DISTANCE(g sdo_geometry, lon number, lat number, distLimit number)
RETURN VARCHAR2 AS 

dist NUMBER;
result VARCHAR2(5);
tmpGeo SDO_GEOMETRY;

BEGIN
  tmpGeo := SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(lon, lat, NULL), NULL, NULL);
  SELECT SDO_GEOM.SDO_DISTANCE(g, tmpGeo, 0.005) INTO dist FROM dual;

  IF dist <= distLimit THEN
    result := 'TRUE';
  ELSE
    result := 'FALSE';
  END IF;

  RETURN result;

END WITHIN_DISTANCE;

To use this function in a QueryDsl query I use the following code:
Predicate pred = Expressions.stringTemplate("function('WITHIN_DISTANCE', {0}, {1}, {2}, {3})" , 
                        QEntry.entry.location,
                        loc.getLon(),
                        loc.getLat(),
                        crit.getRadius()).eq("TRUE");

