[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[eclipselink-users] Batch insert
|
- From: Leen Toelen <toelen@xxxxxxxxx>
- Date: Wed, 3 Jun 2009 12:23:01 +0200
- Delivered-to: eclipselink-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=HaEOcN0m737kRsplrPHJ+7aAGnAPJ5ev5UyC6u904L8=; b=ACP8fbcY3XvLhCruRC0FhcY/XzI2Hg1tThQGFwezDK7UjU/yZZ5Zi/igbMUdwapEi6 z9nnIznAZhWJkY2x2ueQalSyO787MSVRaRlFmEnrRj5HFPmyB9i7IQmf+5SHC6vOpcmh eGlTlrnNkVVdSq+/J9n7bSMHsdCqSyEy7Dl04=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=hByr0Lzady3CHBg+9LxLFL46sqdYhBlM3mYcmx40L/+VaeppuwYLIJQfA7FsR1yA1A i+ZyFM0Oa5SwS/MlUxGd7iYa55Cjq6ISlBFbxnPP3iM1GTzgf5ITafWCQnofRNnbhPSa lapQDLkPhq5GZTX0KKdetFgFibrk/FHUfGiHU=
Hi,
what is the recommended way to batch insert an object tree using eclipselink? I have a three-level object tree, where each parent has a one tot many relationship with its children.
A
- B
- C
- C
- C
- C
- C
- B
- C
- C
- C
-B
- C
When I use em.persist(a) with logging set to FINEST, I notice that each object generates a separate insert statement, and a "select @@IDENTITY" after the insert. The persist is transactional, so all inserts are committed at the same time, but is there a way to only create a single insert statement fot the C objects with multiple parameters like this
insert into C(col1,col2,B_ID)
values
(...,...,...)
(...,...,...)
(...,...,...)
(...,...,...)
(...,...,...)
and execute this in one go?
I tried eclipselink.jdbc.batch-writing "JDBC", but this only batches a single insert of C, which does not solve the problem.
Does anyone has an idea to improve batch insertion time?
Regards,
Leen Toelen