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: log4j would like to only see updates,inserts and deletes
PostPosted: Wed Aug 09, 2006 9:33 am 
Newbie

Joined: Fri Jun 16, 2006 10:15 am
Posts: 2
I would like to see what hibernate is doing in order to determine what specifically is breaking in my code.

Hibernate version: 2

I am getting this exception
Quote:
Caused by: org.springframework.orm.hibernate.HibernateSystemException: a different object with the same identifier value was already associated with the session: 1165, of class: com.*****.model.businessobject.ServiceJobCrane; nested exception is net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 1165, of class: com.*****.model.businessobject.ServiceJobCrane


..


Caused by: net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 1165, of class: com.*****.model.businessobject.ServiceJobCrane


I'm assuming my constraint

Code:
       <set name="cranes" lazy="false" inverse="true"
           order-by="ServiceJobCraneID_PK" cascade="all-delete-orphan" >
            <key column="ServiceJobID_FK" foreign-key="ServiceJobID_FK" />
            <one-to-many
                class="com.wolverinecrane.model.businessobject.ServiceJobCrane" />
        </set>


is not allowing me to write over insert ,delete or update .(IT appears to crash on a hibernatetemplate.saveorupdate function and I am unable to debug through the hibernate code )

I would like to specify log4j to only show updates,inserts or deletes.
In log4j.properties I have the following:

Quote:
log4j.logger.net.sf.hibernate.SQL=INFO, wolvLog


If I change this to Debug and I tail the log I see all the Select Statements. I would like to see everything but the Select Statements. Is there an easy way to do this in log4j. I have been scouring google but I have not found a similar request anywhere on the web.

SQL Profiler for MSSQL spits out a bunch of junk whenever hibernate is called, else I would use that to discover what might be going wrong.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 09, 2006 10:36 am 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Hmm...

Try this

Code:
log4j.logger.net.sf.hibernate.SQL=DEBUG, wolvLog
log4j.logger.net.sf.hibernate.SQL.Select=INFO, wolvLog


I don't have access to Hibernate 2 source at the moment, but I will assume the org.hibernate.SQL classes match the net.sf.hibernate.SQL classes.


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.