[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [eclipselink-users] Batch insert
|
- From: Tim Hollosy <hollosyt@xxxxxxxxx>
- Date: Wed, 3 Jun 2009 07:59:03 -0400
- 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:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=5SqM0RSX8k4EQcPBIlIL4VkdaNpK4rlnBZ1bZvpy4w0=; b=GSg4Wt2zHWU0R7MUnk42aq4D2h09pJXtJT6yNQMtLQSobUoMRpIZ3sQ57kXeenjYdD T285BBrUWqSdESYXW7CdwVjOSZ+nkGxojQAyID2x2Y4EtpQJuOc9YeC9Es9mJGFM+ysp /KzaGwiU8myDbbW5BVKntwvxkCihe6KIEolvY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=txzyyLel3q4/enOvfDsODcuf0Naef4qqqKpBWeGuM8VH1Eeys8nu3gkxo4Kv+7cud1 6F6mgMJnUCTfF4DKgAka0EwWPh3y66egDt5vZxZWjIRVJaNjBALlKEMd4DBcNFI5xtDM 2MySEzSd7R1U4MAARYFWaROGsmJVR7o+d2/g0=
Check out the wiki on batch writing:
http://wiki.eclipse.org/Optimizing_the_EclipseLink_Application_(ELUG)#How_to_Use_Batch_Writing_for_Optimization
./tch
On Wed, Jun 3, 2009 at 6:23 AM, Leen Toelen <toelen@xxxxxxxxx> wrote:
> 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
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>