Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Insert Error

You mention that you were debugging at the constructor but a new instance is not required to cause an insert.  Only an instance that is new to the Persistence Context/Entity Manager.  You can update the logging level to finest and you will see the internal lifecycle calls but what I was suggesting was that instead of debugging at the Constructor you should be debugging at the Entity Manager level to detemine at which point this Entity is associated with the EM and the EM assumes that it is new.  This should only happen on a EM persist. 

Does your system have concurrent access?  Is it possible two threads are creating an object with the same PK?  Are you us generated pks?  What happens in the transaction where the Entity is inserted again?
--Gordon

Kevin Haskett wrote:
Also, what do you mean by track the EntityManager API usage?  Is that
done by having the logging set to FINEST? 

-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Gordon Yorke
Sent: Wednesday, February 24, 2010 9:41 AM
To: EclipseLink User Discussions
Subject: Re: [eclipselink-users] Insert Error

When the top level domain object is "updated" what API is being used?  
em.persist(), em.merge().  What cache settings are being used?
You need to track the EntityManager API usage when this object is
involved.
--Gordon

khaskett wrote:
  
I'm trying to track down an issue with my application.  We have 
several nested domain objects that get updated during a lengthy 
process.  At the end we call the .update on a high level object.  In 
most cases this seems to work fine.  But in some scenarios, we get a 
database error. Here is the error - Exception [EclipseLink-4002] 
(Eclipse Persistence Services -
1.2.0.v20091016-r5565): 
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: [SQL0407] Null values not 
allowed in column or variable TRANS00004. Error Code: -407 Call: 
INSERT INTO CP_TRANSACTION

This is the top level domain, and it looks like it is trying to create
    
  
a new instance of this Domain object.  But during the process we never
    
  
create this instance.

Is there a way to track down the domain object instance that initiates
    
  
this creation?  I have put breakpoints in the Domain object itself in 
the default constructor and they do not go through this method.  Any
    
other suggestions?
  
Because it is such a lengthy process I have not figured out what path 
it is taking that seems to cause this.


  
    
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this message
immediately if this is an electronic communication.

Thank you.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
  

Back to the top