This query seems to be the culprit:
List msoIds =
(List) ses.find("select distinct cr.msoId from cr in class
com.comcast.cable.dmc.itd.cct.persistence.ChangeRequest");
The problem appeared to be that I was trying to open two sessions - though I
thought my ThreadLocal-enabled class would handle this - "Opened hibernate
session." would only show up once in the logs.
public static final ThreadLocal session = new ThreadLocal();
public static Session currentSession()
throws HibernateException, SQLException {
Session s = (Session) session.get();
if (s == null) {
s = sf.openSession();
if (log.isDebugEnabled()) {
log.debug("Opened hibernate session.");
}
session.set(s);
}
return s;
}
What was happening in my situation is that ActionFilter would instantiate a
session, and do a couple queries to the database, and then forward to an
Action class. The action class would then get the currentSession and call
again - that's where the error would occur. So I closed the session in my
ActionFilter (before doFilter) and it fixed the problem.
Thanks for listening,
Matt
> -----Original Message-----
> From: Raible, Matt
> Sent: Thursday, February 06, 2003 3:52 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: [Hibernate] Error: cannot modify a column which maps to a
> non key-preserved t able
>
>
> It appears that Hibernate is trying to do an update on the
> view when I go
> from getting a user's information to getting some more
> information. Is
> there any way I can turn this off. This is the offending
> query, which I'm
> never calling:
>
> DEBUG [Ajp13Processor[11009][4]] UserAction.edit(87) | Entering 'edit'
> method
> Hibernate: update v_ccr_details set ccr_status_desc = ?,
> ccr_status_id = ?,
> form_id = ?, form_desc =
> ?, headend_name = ?, mso_desc = ?, sheet_id = ?, sheet_desc = ?,
> status_desc = ?, status_id = ?, ch
> ange_type = ?, changed_by = ?, created_by = ?, dt_changed =
> ?, dt_created =
> ?, desired_complete_date
> = ?, elog_id = ?, headend_id = ?, msg_id = ?, mso_id = ?,
> requestor = ?
> where CCR_ID = ? and FORM_I
> D = ? and SHEET_ID = ?
> WARN [Ajp13Processor[11009][4]]
> JDBCExceptionReporter.logExceptions(35) |
> SQL Error: 1779, SQLState:
> 42000
> ERROR [Ajp13Processor[11009][4]]
> JDBCExceptionReporter.logExceptions(42) |
> ORA-01779: cannot modify
> a column which maps to a non key-preserved table
>
> Thanks,
>
> Matt
>
> > -----Original Message-----
> > From: Raible, Matt
> > Sent: Thursday, February 06, 2003 3:39 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: [Hibernate] Error: cannot modify a column which
> maps to a non
> > key-preserved t able
> >
> >
> > I'm getting the following error when I login -> ActionFilter
> > gets user's
> > information -> UserAction class gets more information:
> >
> > 2003-02-06 15:29:43,312 ERROR
> > cirrus.hibernate.helpers.JDBCExceptionReporter - ORA-01779:
> > cannot modify a
> > column which maps to a non key-preserved table
> >
> > If I login -> ActionFilter - JSP, I'm fine. I don't know
> if this has
> > anything to do with Hibernate, but I *think* it might have
> > something to do
> > with my Hibernate session instantiation.
> >
> > In ActionFilter I have:
> >
> > public static Session getSession() throws HibernateException,
> > SQLException {
> > return ServiceLocator.currentSession();
> > }
> >
> > I'm calling this in both ActionFilter and in UserAction.
> >
> > ServiceLocator is a ThreadLocal-enabled class with the following
> > currentSession() method:
> >
> > public static Session currentSession()
> > throws HibernateException, SQLException {
> > Session s = (Session) session.get();
> >
> > if (s == null) {
> >
> > s = sf.openSession();
> >
> > if (log.isDebugEnabled()) {
> > log.debug("Opened hibernate session.");
> > }
> >
> > session.set(s);
> > }
> >
> > return s;
> > }
> >
> > The debug statement is only called once in the first sequence
> > I described -
> > so it doesn't *seem* like a Session issue, but who knows.
> >
> > Thanks,
> >
> > Matt
> >
> >
> >
> > -------------------------------------------------------
> > This SF.NET email is sponsored by:
> > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> > http://www.vasoftware.com
> > _______________________________________________
> > hibernate-devel mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> >
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
>
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel