-->
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.  [ 2 posts ] 
Author Message
 Post subject: update on table 1 executed when exec findby query on table2
PostPosted: Thu Mar 08, 2007 2:15 pm 
Newbie

Joined: Thu Mar 08, 2007 1:51 pm
Posts: 4
Why is Hibernate running an update of my foo object when I excute a findBy on my derp table? I am not updating my foo object.

EJB:

While(aFewTimes){

foosList = fooHome.findByFooId(new BigDecimal(fooId()), session);
Iterator foosIter = foosList.iterator();

while (foosList.hasNext()) {
List xxxxList = xxxxxHome.findByDerpId(new BigDecimal(derpId), session);
}

}

DerpHome:

public List findByDerpId(BigDecimal derpId, Session session){

Criteria crit = session.createCriteria(
XXXXXXXXXXX.Derp.class).add(
Restrictions.eq("derpId", derpId));
List awardList = crit.list();
return awardList;
}

First Excute of findByDerpId: select this_.derpicord as derpy_686_0_ from derp this_ where this_.derps=?

Second Excute of findByDerpId: Hibernate: update foo set foo_Column=?, foo_COLUMN_2=? where foo_ID=?


I do not have permissions to update the table, nor did i request to do this.

[3/8/07 13:20:46:319 EST] 00000010 JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: 1031, SQLState: 42000
[3/8/07 13:20:46:319 EST] 00000010 JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions ORA-01031: insufficient privileges


Any ideas why this is happening?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 3:27 pm 
Newbie

Joined: Thu Mar 08, 2007 1:51 pm
Posts: 4
Kids, please remember to add mutable="false" in your .hbm.xml files if the "table" is really a read-only view!


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