Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hi, I'm trying to update a specific row in my table, but I got the following error from Jonas console:
Can anyone please help me.
Thanks in advance
[b]Hibernate version: 3.0 [/b]
[b]Mapping documents:[/b]
[b]Code between sessionFactory.openSession() and session.close():
session = HibernateUtil.currentSession();
tx = session.beginTransaction();
String sql = "FROM GlopUserType u WHERE u.jobTitle = :jobTitle ";
Query query = session.createQuery(sql);
query.setParameter("jobTitle", new String("program"));
GlopUserType usrType = (GlopUserType)query.list().get(0);
usrType.setJobTitle(titleName);
session.saveOrUpdate(usrType);
[/b]
[b]Full stack trace of any exception that occurs:
Jonas Console Error:
2005-04-20 14:01:22,229 : SchemaUpdate.execute : schema update complete
2005-04-20 14:01:22,323 : ReadOnlyCache.lock : Application attempted to edit read only item: org.objectweb.alarm.beans.GlopUserType#1
2005-04-20 14:01:22,323 : ReadOnlyCache.release : Application attempted to edit read only item: org.objectweb.alarm.beans.GlopUserType
java.lang.UnsupportedOperationException: Can't write to a readonly object
at org.hibernate.cache.ReadOnlyCache.lock(ReadOnlyCache.java:43)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:69)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:675)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at org.objectweb.alarm.beans.SessionTataBean.updateUserType(Unknown Source)
at org.objectweb.alarm.beans.JOnASSessionTata437579213Remote.updateUserType(JOnASSessionTata437579213Remote.java:216)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.runDispatch(JUnicastServerRef.java:160)
at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:145)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
[/b]
[b]Name and version of the database you are using: Postgresql 8.0 [/b]
[b]The generated SQL (show_sql=true):[/b]
[b]Debug level Hibernate log excerpt:[/b]