Re: SQL server with hibernate spatial. [SEC=UNCLASSIFIED] [SEC=UNCLASSIFIED]

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: SQL server with hibernate spatial. [SEC=UNCLASSIFIED] [SEC=UNCLASSIFIED]

Steve Cameron

Got this working now.

 

My own fault though, I went back to the MS SQL Server JDBC driver that I could not get to work last week, it was just hanging when it connected. No joy from MSDN forum on that problem so I’d swapped to the jTDS JDBC driver, which then gave me the problem below after adding a spatial type property to a class.

 

So looking again for the reason for the original problem, there was an issue using Java 1.6 with MS JDBC driver http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7103725. So I decided to try Java 1.7.

 

This does not give me a hung connection and I’m getting a geometry column created in my db table, so I assume it’s all a goer now.

 

Thanks for your assistance anyway.

 

Stephen Cameron

Antarctic Fisheries Computing and Database Support Provider

Australian Antarctic Division

Kingston, Tasmania

 

EmailSig (2)

Phone: 03 62323571

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Steve Cameron
Sent: Thursday, 22 March 2012 12:04 PM
To: Hibernate Spatial Users Discussion
Subject: [hibernatespatial-users] SQL server with hibernate spatial. [SEC=UNCLASSIFIED]

 

I am a bit further along the track now that I am using correct version of hibernate jar with hibernate spatial 1.1.1

 

Now I see the following errors

 

1019 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: HY000

1019 [main] ERROR org.hibernate.util.JDBCExceptionReporter - The TDS protocol does not support JDBC datatype 2003.

javax.persistence.RollbackException: Error while committing the transaction

       at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:93)

       at au.gov.aad.fisheries.test.TestMain.main(TestMain.java:61)

Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not insert: [au.gov.aad.fisheries.HaulFish]

       at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1389)

       at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1317)

       at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:81)

       ... 1 more

Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [au.gov.aad.fisheries.HaulFish]

       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)

       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)

       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2455)

       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2875)

       at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)

       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)

       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)

       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)

       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)

       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)

       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)

       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)

       at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:76)

       ... 1 more

Caused by: java.sql.SQLException: The TDS protocol does not support JDBC datatype 2003.

       at net.sourceforge.jtds.jdbc.TdsData.getNativeType(TdsData.java:1537)

       at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareSQL(ConnectionJDBC2.java:640)

       at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:503)

       at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)

       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2435)

       ... 12 more

 

Stephen Cameron

Antarctic Fisheries Computing and Database Support Provider

Australian Antarctic Division

Kingston, Tasmania

 

EmailSig (2)

Phone: 03 62323571

 

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________


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