openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-1986) Extra queries being generated when cascading a persist
Date Mon, 24 Mar 2014 16:36:52 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13945324#comment-13945324
] 

ASF subversion and git services commented on OPENJPA-1986:
----------------------------------------------------------

Commit 1580907 from [~jpaheath] in branch 'openjpa/branches/2.2.1.x'
[ https://svn.apache.org/r1580907 ]

OPENJPA-1986: Extra queries being generated when cascading a persist - added another/similar
check to the ones added by Rick.

> Extra queries being generated when cascading a persist
> ------------------------------------------------------
>
>                 Key: OPENJPA-1986
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1986
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: performance
>    Affects Versions: 2.0.1, 2.1.0, 2.2.0
>            Reporter: Rick Curtis
>            Assignee: Rick Curtis
>             Fix For: 2.1.1, 2.2.0
>
>         Attachments: OPENJPA-1986.patch
>
>
> I found a scenario where extra queries were being generated while cascading a persist
to a new Entity. See the following example:
> @Entity
> public class CascadePersistEntity implements Serializable {
>     private static final long serialVersionUID = -8290604110046006897L;
>     @Id
>     long id;
>     @OneToOne(cascade = CascadeType.ALL)
>     CascadePersistEntity other;
> ...
> }
> and the following scenario:
> CascadePersistEntity cpe1 = new CascadePersistEntity(1);
> CascadePersistEntity cpe2 = new CascadePersistEntity(2);
> cpe1.setOther(cpe2);
> em.persist(cpe1);
> This results in two inserts and one select. The extra select is what I'm going to get
rid of with this JIRA.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message