camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <cmoulli...@gmail.com>
Subject camel-example-etl & openJPA (If this is a new instance, make sure any version and/or auto-generated primary key fields are null/default when persisting)
Date Mon, 07 Dec 2009 12:11:19 GMT
When I try to use the example camel-example-etl with openJPA, here is the
error that I receive

[ Camel thread 0: FileComponent] Tracer                         INFO
be7ae591-e2ea-4021-8179-d6bdd5f5398c >>> (route1)  -->
jpa://org.apache.camel.ex
ample.etl.CustomerEntity?consumeLockEntity=true <<< Pattern:InOnly,
Headers:{CamelFileNameOnly=row2.xml,
CamelFileAbsolutePath=D:\Dvlpt\Java\workspace
\apache-camel-source\examples\camel-example-etl\src\data\row2.xml,
CamelFileRelativePath=row2.xml, CamelFileName=row2.xml,
CamelFilePath=src\data\row2
.xml, CamelFileParent=src\data, CamelFileAbsolute=false,
CamelFileLength=982, CamelFileLastModified=Tue Jul 14 10:37:40 CEST 2009},
BodyType:org.apach
e.camel.example.etl.PersonDocument, Body:<person
user="hiram"><firstName>Hiram</firstName><lastName>Chirino</lastName><city>Tampa</city></person>
16094  camel  TRACE  [Camel thread 0: FileComponent] openjpa.jdbc.SQL - <t
12662763, conn 1634627> executing prepstmnt 585058
SELECT t0.id, t0.city, t0.firstName, t0.phone, t0.street, t0.surname,
        t0.userName, t0.zip
    FROM Customer t0
    WHERE (t0.userName = ?)
[params=(String) hiram]
16094  camel  TRACE  [Camel thread 0: FileComponent] openjpa.jdbc.SQL - <t
12662763, conn 1634627> [0 ms] spent
[ Camel thread 0: FileComponent] CustomerTransformer            DEBUG
Created customer: Customer[userName: hiram firstName: Hiram surname:
Chirino]
16110  camel  TRACE  [Camel thread 0: FileComponent] openjpa.jdbc.SQL - <t
12662763, conn 21035203> executing prepstmnt 19041450
SELECT t0.city, t0.firstName, t0.phone, t0.street, t0.surname,
        t0.userName, t0.zip
    FROM Customer t0
    WHERE t0.id = ?
[params=(long) 0]
16110  camel  TRACE  [Camel thread 0: FileComponent] openjpa.jdbc.SQL - <t
12662763, conn 21035203> [0 ms] spent
[ Camel thread 0: FileComponent] DefaultErrorHandler            DEBUG Failed
delivery for exchangeId: be7ae591-e2ea-4021-8179-d6bdd5f5398c. On deliver
y attempt: 0 caught:
org.springframework.dao.DataIntegrityViolationException: Attempt to persist
detached object "org.apache.camel.example.etl.Custome
rEntity@8bfa09".  If this is a new instance, make sure any version and/or
auto-generated primary key fields are null/default when persisting.; nested
exception is <openjpa-1.3.0-SNAPSHOT-r422266:881892 nonfatal store error>
org.apache.openjpa.persistence.EntityExistsException: Attempt to persist det
ached object "org.apache.camel.example.etl.CustomerEntity@8bfa09".  If this
is a new instance, make sure any version and/or auto-generated primary key
 fields are null/default when persisting.

Anybody has an idea to avoid this ?

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message