Here you go:

http://opensource.atlassian.com/projects/hibernate/browse/HHH-1934

it's only three lines, but enhances two logging entries, so will I have three 
lines free on the next issue ;-) ?? 

anyway, I'd really like to see the logging on those issues improved, since I've 
spent quite some time to hunt them down (I suppose other people will have the 
same problems).

thanks for the good work :-)

Max Rydahl Andersen wrote:

>
> submit a patch in jira that sends it to log.trace (in less than 4  individual 
> lines ;) and we will consider it.
>
> /max
>
>> Hi,
>>
>> I'm trying to debug/fix Hibernate messages like  
>> "org.hibernate.NonUniqueObjectException: a different object with the  same 
>> identifier value was already associated with the session: "... and  I find 
>> the default exception logging in  AbstractSaveEventListener#performSave not 
>> sufficient. I've added some  System.err.printlns() with the information I 
>> typically need. It would be  great if this debug info would make it somehow 
>> into the latest SVN.
>>
>> Rgds
>> Holger
>>
>>     /**
>>      * Ppepares the save call by checking the session caches for a  
>> pre-existing
>>      * entity and performing any lifecycle callbacks.
>>      * @param entity The entity to be saved.
>>      * @param id The id by which to save the entity.
>>      * @param persister The entity's persister instance.
>>      * @param useIdentityColumn Is an identity column in use?
>>      * @param source The session from which the event originated.
>>      * @param requiresImmediateIdAccess does the event context require
>>      * access to the identifier immediately after execution of this method  
>> (if
>>      * not, post-insert style id generators may be postponed if we are  
>> outside
>>      * a transaction).
>>      * @return The id used to save the entity; may be null depending on the
>>      * type of id generator used and the requiresImmediateIdAccess value
>>      * @throws HibernateException
>>      */
>>     protected Serializable performSave(
>>             Object entity,
>>             Serializable id,
>>             EntityPersister persister,
>>             boolean useIdentityColumn,
>>             Object anything,
>>             EventSource source,
>>             boolean requiresImmediateIdAccess)
>>     throws HibernateException {
>>
>>         if ( log.isTraceEnabled() ) {
>>             log.trace(
>>                     "saving " +
>>                     MessageHelper.infoString( persister, id, 
>> source.getFactory() )
>>                 );
>>         }
>>        
>>         EntityKey key;
>>         if ( !useIdentityColumn ) {
>>             key = new EntityKey( id, persister, source.getEntityMode() );
>>             Object old = source.getPersistenceContext().getEntity(key);
>>             if (old != null) {
>>                 if ( 
>> source.getPersistenceContext().getEntry(old).getStatus() ==  Status.DELETED 
>> ) {
>>                     source.forceFlush( 
>> source.getPersistenceContext().getEntry(old) );
>>                 }
>>                 else {
>>                     System.err.println("old: " + old);
>>                     System.err.println("old.class: " + old.getClass());
>>                     System.err.println("entity: " + entity);
>>                     System.err.println("entity.class: " + entity.getClass());
>>                     System.err.println("id: " + id);
>>                     throw new NonUniqueObjectException( id, 
>> persister.getEntityName() );
>>                 }
>>             }
>>             persister.setIdentifier(entity, id, source.getEntityMode());
>>         }
>>         else {
>>             key = null;
>>         }
>>        
>>         if ( invokeSaveLifecycle(entity, persister, source) ) {
>>             return id; //EARLY EXIT
>>         }
>>
>>         return performSaveOrReplicate(
>>                 entity,
>>                 key,
>>                 persister,
>>                 useIdentityColumn,
>>                 anything,
>>                 source,
>>                 requiresImmediateIdAccess
>>             );
>>     }
>>
>
>
>


-- 


Holger Haag
Geschäftsführer

SoftConEx GmbH
Zossener Straße 55
D-10961 Berlin

Telefon: ++49 (0) 30 63901692
Fax: ++49 (0) 30 63901669
Mobil: ++49 (0) 1511 7810317


-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*. Nur noch kurze Zeit!
"Feel free" mit GMX DSL: http://www.gmx.net/de/go/dsl

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to