[teiid-issues] [JBoss JIRA] (TEIID-2502) org.teiid.net.socket.SingleInstanceCommunicationException

luca gioppo (JIRA) jira-events at lists.jboss.org
Fri May 17 03:40:06 EDT 2013


    [ https://issues.jboss.org/browse/TEIID-2502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774949#comment-12774949 ] 

luca gioppo commented on TEIID-2502:
------------------------------------

The query is a select so it seems that the getObject method does not work as expected (why it issues a writeObject??).

The actual value of the geometry column is a SDO_POINT_TYPE (I believe the DB is not under my complete control :-) I'm the virtualizator guy that has to do the magic on a black box :( ) it should be a struct.

--- from Oracle site ---
oracle.spatial.geometry.JGeometry

All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class JGeometry

extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

A Java class that maps Oracle Spatial's SQL type MDSYS.SDO_GEOMETRY. Supports only Oracle JDBC Driver version 8.1.7 or higher. Provides basic access functions to the geomeries stroed in Oracle Spatial database.

Note that this class is not synchornized, meaning if one thread is reading this geometry and another is modifying it (such as changing its ordinates array), there may be in-consistencies.
The main methods for reading/writing db geometries are: load(STRUCT) and store(). Here is a simple example showing how to use these two methods:

     /// reading a geometry from database
     ResultSet rs = statement.executeQuery("SELECT geometry FROM states where name='Florida'");
     STRUCT st = (oracle.sql.STRUCT) rs.getObject(1);
     //convert STRUCT into geometry
     JGeometry j_geom = JGeometry.load(st);

     // ... manipulate the geometry or create a new JGeometry ...

     /// writing a geometry back to database
     PreparedStatement ps = connection.prepareStatement("UPDATE states set geometry=? where name='Florida'");
     //convert JGeometry instance to DB STRUCT
     STRUCT obj = JGeometry.store(j_geom, connection);
     ps.setObject(1, obj);
     ps.execute();
  
--- end ---
So maybe a struct could be better than object? Is something that can be tried on my part or a patch yuo need to address?

I believe that using JTS could help (to get an open source licenced lib), but have not other hints.

There is a bug on the hibernatespatial http://www.hibernatespatial.org/jira/browse/HIBSPA-21, but do not know if can be of any help.


                
> org.teiid.net.socket.SingleInstanceCommunicationException
> ---------------------------------------------------------
>
>                 Key: TEIID-2502
>                 URL: https://issues.jboss.org/browse/TEIID-2502
>             Project: Teiid
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: 8.2
>         Environment: centos 6.3
>            Reporter: luca gioppo
>            Assignee: Steven Hawkins
>            Priority: Critical
>
> I'm issuing a query (a simple select * from table) on a VDB's table that contains a geometric column from oracle spatial.
> I'm getting the following error in SquirrelSQL
> Error: org.teiid.net.socket.SingleInstanceCommunicationException
> SQLState:  08S01
> ErrorCode: 0
> Afterwards the connection is broken and I cannot access any other table and have to reconnect since I get:
> Error: Error Code:TEIID20013 Message:Error Code:TEIID20013 Message:java.net.SocketException: Socket closed
> SQLState:  TEIID20013
> ErrorCode: 0
> I'm trying to access a SDO table and a geometry type column, but hoped that TEIID could read it as a BLOB without caring about the real type.
> Probably it doesn't like it too much.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the teiid-issues mailing list