-->
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.  [ 7 posts ] 
Author Message
 Post subject: Please help me
PostPosted: Fri Oct 21, 2005 2:55 am 
Newbie

Joined: Thu Oct 20, 2005 9:10 am
Posts: 7
Hi all,

I am using hibernate for persisting the data, Instead of hibernate query I written my own query by using
<sql-insert> and <sql-update> in the <hibernate-mapping> file
and it was working fine.

After adding a new filed in the database table, I just modified the sql-insert and sql-update query but it started giving error like bind variable not matching etc.


********************************************************************
12:13:44,633 ERROR [JDBCExceptionReporter] ORA-01006: bind variable does not exist
12:13:44,633 WARN [JDBCExceptionReporter] SQL Error: 1006, SQLState: 72000
12:13:44,633 ERROR [JDBCExceptionReporter] ORA-01006: bind variable does not exist
12:13:44,633 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:162)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
at org.hibernate.event.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:271)
at org.hibernate.event.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:24)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:719)
at com.capco.ortos.orap.data.hibernate.HibernateActionDAO.saveOrUpdateAction(HibernateActionDAO.java:237)
at com.capco.ortos.orap.data.hibernate.HibernateActionDAO.modifyAction(HibernateActionDAO.java:177)
**********************************************************************

Can anyone help me on this problem? is it something like Hibernate old object is stored somewhere?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 3:03 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
your going to have to post the mapping file as well as the java code where you call this.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 3:17 am 
Newbie

Joined: Thu Oct 20, 2005 9:10 am
Posts: 7
Hi I am pasting my hbm file here

**********************************************************
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>


<class name="com.capco.ortos.orap.model.Action" table="A1_Action" lazy="true">

<id name="id" column="Id" type="java.lang.Long">
<generator class="sequence">
<param name="sequence">A_SEQ_ACTIONS</param>
</generator>
</id>
<property name="issueId" column="FK_ISSUE" type="string"/>
<property name="assessor" column="FK_ASSESSOR" type="string"/>
<property name="assessorDelegate" column="FK_ASSESSOR_DELEGATE" type="string"/>
<property name="priority" column="FK_PRIORITY" type="string"/>
<property name="type" column="FK_TYPE" type="string"/>
<property name="name" column="NAME" type="string"/>
<property name="description" column="DESCRIPTION" type="string"/>
<property name="captureDate" column="CAPTURE_DATE"/>
<property name="targetCompletionDate" column="TARGET_COMPLETION_DATE" />
<property name="targetReviewDate" column="TARGET_REVIEW_DATE" />
<property name="cost" column="COST" type="string"/>
<property name="estimatedCost" column="ESTIMATED_COST" type="string"/>

<property name="actionReviewed" column="ACTION_IS_REVIEWED" type="string"/>
<property name="percentComplete" column="PERCENT_COMPLETE" type="string"/>
<property name="reminder" column="REMINDER" type="string"/>
<property name="tasksAlreadyTaken" column="TASKS_ALREADY_TAKEN" type="string"/>
<property name="comment" column="COMMENT_GENERAL" type="string"/>
<property name="mileStone" column="IS_MILESTONE" type="string"/>
<property name="lastUpdateUser" column="LAST_CHANGE_USER" type="string"/>
<property name="currency" column="FKQ_CURRENCY" type="string"/>
<property name="revisedTargetComment" column="REVISED_TARGET_COMMENT" type="string"/>

<set name="attachment" inverse="true" cascade="delete">
<key column="FK_ACTION"/>
<one-to-many class="com.capco.ortos.orap.model.ActionAttachment"/>
</set>
<sql-insert>
insert into A1_Action
(FK_ISSUE, FK_ASSESSOR, FK_ASSESSOR_DELEGATE, FK_PRIORITY,
FK_TYPE, NAME, DESCRIPTION, CAPTURE_DATE, TARGET_COMPLETION_DATE, TARGET_REVIEW_DATE,
COST, ESTIMATED_COST, ACTION_IS_REVIEWED,
PERCENT_COMPLETE, REMINDER, TASKS_ALREADY_TAKEN, COMMENT_GENERAL, IS_MILESTONE,
LAST_CHANGE_USER, FKQ_CURRENCY, Id) values (?, ?, ?, ?, ?, ?, ?, to_date(?,'YYYY.MM.DD'), to_date(?,'YYYY.MM.DD'), to_date(?,'YYYY.MM.DD'), ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?)
</sql-insert>

<sql-update>
update A1_Action set FK_ISSUE=?, FK_ASSESSOR=?, FK_ASSESSOR_DELEGATE=?, FK_PRIORITY=?, FK_TYPE=?,
NAME=?, DESCRIPTION=?, CAPTURE_DATE=to_date(?,'YYYY.MM.DD'), TARGET_COMPLETION_DATE=to_date(?,'YYYY.MM.DD'),
TARGET_REVIEW_DATE=to_date(?,'YYYY.MM.DD'), COST=?, ESTIMATED_COST=?, ACTION_IS_REVIEWED=?,
PERCENT_COMPLETE=?, REMINDER=?, TASKS_ALREADY_TAKEN=?, COMMENT_GENERAL=?, IS_MILESTONE=?, LAST_CHANGE_USER=?,
FKQ_CURRENCY=? where Id=?
</sql-update>
</class>

</hibernate-mapping>


*********************************************************

And calling through


Session session = HibernateSession.currentSession();
if (action.isUpdateFlag()) {
session.update(action);

where action is the info object

******************************************************

also getting error like

11:27:32,976 WARN [JDBCExceptionReporter] SQL Error: 1747, SQLState: 42000
11:27:32,976 ERROR [JDBCExceptionReporter] ORA-01747: invalid user.table.column, table.column, or column specification
11:27:32,976 WARN [JDBCExceptionReporter] SQL Error: 1747, SQLState: 42000
11:27:32,976 ERROR [JDBCExceptionReporter] ORA-01747: invalid user.table.column, table.column, or column specification
11:27:32,992 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 4:00 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
which field did you add ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 4:39 am 
Newbie

Joined: Thu Oct 20, 2005 9:10 am
Posts: 7
FKQ_CURRENCY


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 12:19 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
go back to hibernate generated sql and compare what hibernate generates to what you are trying to do. and post a debug level log.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 1:41 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
jaincj wrote:
FKQ_CURRENCY


I'm not sure about the error at the top but this error

Code:
ORA-01747: invalid user.table.column, table.column, or column specification


indicates that your referencing a COLUMN name that isn't in the table.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.