Hibernate version: 2.1.1
Name and version of the database you are using:Sybase 11.9.2.9
I used Hibernate as a O/R mapping to implement my application persistence tier.
My application server is JBoss 3.2.5, it provides a free DB server named HyperSonic. I
can deploy my project in it. However, while I changed the DB server to Sybase DB
server, & I used Hibernate to defaultly create the tables, it prompted
exceptions to show that:
[deploypar] 14:00:32,462 ERROR [JDBCExceptionReporter] could not insert: [org.jbpm.model.definition.
impl.FileImpl#78]
[deploypar] caused by exception : com.sybase.jdbc2.jdbc.SybSQLException
[deploypar] com.sybase.jdbc2.jdbc.SybSQLException: Implicit conversion from datatype 'IMAGE' to 'VARBINARY' is not allowed. Use the CONVERT function to run this query.
[deploypar] at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2408)
[deploypar] at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1844)
[deploypar] at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
[deploypar] at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:201)
[deploypar] at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:182)
[deploypar] at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1479)
[deploypar] at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate(SybStatement.java:1462)
[deploypar] at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.jav
a:88)
[deploypar] at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
[deploypar] at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:469)
[deploypar] at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:443)
[deploypar] at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
[deploypar] at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2308)
[deploypar] at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2261)
[deploypar] at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2187)
[deploypar] at org.jbpm.persistence.hibernate.HibernateSessionJmtTx.commitAndClose(HibernateSess
ionJmtTx.java:40)
The FileImpl class has a property named 'bytes',
and its type is byte[]. as shows:
class:
public class FileImpl {
...
byte[] bytes = null;
public byte[] getBytes() { return this.bytes; }
public void setBytes(byte[] bytes) { this.bytes = bytes; }
...
}
config xml file:
...
<property name="bytes" type="binary" />
...
I don't why it will occur such exception. In fact, I have specified to use SybaseDialect, Also direct to specified connection url.
I have set hibernate propeties:
hibernate.dialect=net.sf.hibernate.dialect.Sybase11_9_2Dialect
hibernate.jdbc.use_streams_for_binary=true
plz help, thanks a lot!
|