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.  [ 1 post ] 
Author Message
 Post subject: Two Mappings on one Table (one without cache, one read-only)
PostPosted: Fri Nov 19, 2004 6:39 am 
Newbie

Joined: Mon Nov 15, 2004 12:27 pm
Posts: 4
Location: Aschaffenburg, Germany
I have mapped a table with a lot of colums to an Object. For use in statistics i invented a "LightObject" version, with only a few colums and cached it read-only.

Then i tried following code:
Code:
List result = session.find( "select o from LightObject as o  left join o.entries as oe WHERE oe.someInformation is not null" );

for( Iterator it = result.iterator(); it.hasNext(); )
{
  LightObject lo = (LightObject it.next();
Object ob = ObjectDAO.getInstance().load( lo.getId() );
  ob.setSomeFlag( 1 );
  ObjectDAO.getInstance().saveOrUpdate( order );
}


2004-11-19 10:17:09,092 ERROR [main] (ReadOnlyCache.java:35) - Application attempted to edit read only item: 948
java.lang.UnsupportedOperationException: Can't write to a readonly object
at net.sf.hibernate.cache.ReadOnlyCache.lock(ReadOnlyCache.java:36)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:50)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2336)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at ........


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

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.