-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Exception : Expected NUMBER got BINARY
PostPosted: Wed Mar 15, 2006 6:44 am 
Regular
Regular

Joined: Wed Mar 08, 2006 2:07 am
Posts: 50
Location: Bangalore
Why am i getting this exception :
I had it earlier also in a small example, but somehow got rid of it, by using 'assigned' mechanism for PK generation. But right now i am using 'native' mechanism for PK generation. Does this error occur because a Java null value is being put in a property for hibernate which expects a particular data of a particular type ?


Hibernate version: 3.1

Full stack trace of any exception that occurs:
Code:
2006-03-15 15:35:59 ERROR MessageID(CCG-PDC-Workflow,PACS-ADT.1.159,admitPatient) "Workflow Exception" [com.ge.medit.pdm.messaging.Dispatcher]
com.ge.medit.pdm.dao.DataAccessException: Failed to commit transaction
   at com.ge.medit.pdm.dao.ServiceLocator.commitTransaction(ServiceLocator.java:245)
   at com.ge.medit.pdm.dao.TransactionManager.commitTransaction(TransactionManager.java:12)
   at com.ge.medit.pdm.messaging.workflow.PatientWorkflowManager.admitPatient(PatientWorkflowManager.java:94)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.ge.medit.pdm.messaging.services.WorkflowService.handleMessage(WorkflowService.java:57)
   at com.ge.medit.pdm.messaging.Dispatcher.dispatch(Dispatcher.java:160)
   at com.ge.medit.pdm.messaging.WorkerThread.run(WorkerThread.java:90)
Caused by: org.hibernate.exception.SQLGrammarException: could not insert: [com.ge.medit.pdm.hibernate.valueobjects.Patient]
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2078)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2427)
   at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
   at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:356)
   at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
   at com.ge.medit.pdm.dao.ServiceLocator.commitTransaction(ServiceLocator.java:240)
   ... 9 more
Caused by: java.sql.SQLException: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY

   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
   at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
   at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
   at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
   at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
   at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
   at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
   at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2065)
   ... 20 more

Name and version of the database I am using:
Oracle 10g


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 12:29 pm 
Regular
Regular

Joined: Wed Mar 08, 2006 2:07 am
Posts: 50
Location: Bangalore
Any anyone tell me what are the circumstances in which this error occurs...
I have seen posts such as this but nowhere has this exception been answered about properly.
I have changed all "long" types in .hbm.xml files to "java.lang.Long".
I have even initialized those at their declaration itself to " new Long(0); " ... but still keep getting same error.

...really looking for a solution to it.


Top
 Profile  
 
 Post subject: solution: Mismatch in hbm attributes
PostPosted: Thu Oct 16, 2008 12:42 pm 
Newbie

Joined: Tue Jun 26, 2007 12:19 pm
Posts: 4
Rot cause is mismatch in attribute in hbm file like instead of "class", "type" may be specied for an pojo while mapping it in many-to-one mapping.

Wrong one: which throws Exception:
<property name="divId" column="QUEUE_ID" type="com.PAOutboundQueue" />

Corrected one:
<many-to-one name="paOutboundQueue" class="com.PAOutboundQueue" column="QUEUE_ID"/>


Last edited by ctbalamurali on Thu Oct 16, 2008 12:52 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: solution: Mismatch in hbm attributes
PostPosted: Thu Oct 16, 2008 12:42 pm 
Newbie

Joined: Tue Jun 26, 2007 12:19 pm
Posts: 4
Rot cause is mismatch in attribute in hbm file like instead of "class", "type" may be specied for an pojo while mapping it in many-to-one mapping.

Wrong one: which throws Exception:
<property name="divId" column="QUEUE_ID" type="com.PAOutboundQueue" />

Corrected one:
<many-to-one name="paOutboundQueue" class="com.PAOutboundQueue" column="QUEUE_ID"/>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.