From dev-return-11933-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Fri May 15 19:34:08 2009 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 45822 invoked from network); 15 May 2009 19:34:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 May 2009 19:34:08 -0000 Received: (qmail 69418 invoked by uid 500); 15 May 2009 19:34:08 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 69371 invoked by uid 500); 15 May 2009 19:34:07 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 69361 invoked by uid 99); 15 May 2009 19:34:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2009 19:34:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2009 19:34:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8AEBD234C004 for ; Fri, 15 May 2009 12:33:45 -0700 (PDT) Message-ID: <1344405892.1242416025554.JavaMail.jira@brutus> Date: Fri, 15 May 2009 12:33:45 -0700 (PDT) From: "Donald Woods (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Closed: (OPENJPA-247) new-delete-new-find doesn't work MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Donald Woods closed OPENJPA-247. -------------------------------- Resolution: Cannot Reproduce applied testcase showing that this failure no longer exists to 1.3.x and trunk Thanks BJ for the testcase patch. > new-delete-new-find doesn't work > -------------------------------- > > Key: OPENJPA-247 > URL: https://issues.apache.org/jira/browse/OPENJPA-247 > Project: OpenJPA > Issue Type: Test > Reporter: Dain Sundstrom > Assignee: Donald Woods > Priority: Minor > Fix For: 1.3.0, 2.0.0 > > Attachments: OPENJPA-247.patch > > > I have a piece of code that effectively does the same thing the following test does: > private void newDeleteNew() throws Exception { > beginTx(); > // Create new > Person dain = new Person(); > dain.setName("dain"); > assertFalse(entityManager.contains(dain)); > entityManager.persist(dain); > entityManager.flush(); > assertTrue(entityManager.contains(dain)); > // Find and verify > dain = entityManager.find(Person.class, "dain"); > assertNotNull(dain); > assertEquals("dain", dain.getName()); > // Delete > entityManager.remove(dain); > entityManager.flush(); > assertFalse(entityManager.contains(dain)); > // Recreate > dain = new Person(); > dain.setName("dain"); > assertFalse(entityManager.contains(dain)); > entityManager.persist(dain); > entityManager.flush(); > assertTrue(entityManager.contains(dain)); > // Find and verify > dain = entityManager.find(Person.class, "dain"); > assertNotNull(dain); // <<<<<<< FAILS > assertEquals("dain", dain.getName()); > commitTx(); > } > The test fails at the marked point, because the entityManager seems to think the "dain" entity is still deleted. I assume this type of code would work. Is this a bug or is my assumption wrong? > BTW, I'm using 0.9.8-incubating-SNAPSHOT > And here is my entity class: > @Entity > public class Person { > private String name; > @Id > public String getName() { > return name; > } > public void setName(String name) { > this.name = name; > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.