Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 4157 invoked from network); 3 Apr 2008 11:28:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Apr 2008 11:28:14 -0000 Received: (qmail 68276 invoked by uid 500); 3 Apr 2008 11:28:11 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 68266 invoked by uid 500); 3 Apr 2008 11:28:11 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 68254 invoked by uid 99); 3 Apr 2008 11:28:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Apr 2008 04:28:11 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [62.20.1.174] (HELO amail1.space2u.com) (62.20.1.174) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Apr 2008 11:27:27 +0000 Received: from nino-martinez-vazquez-waels-computer-191.local (0x53588ed3.bynxx9.adsl-dhcp.tele.dk [83.88.142.211]) (authenticated bits=0) by amail1.space2u.com (8.14.2/8.13.8) with ESMTP id m33BRZoT030834 for ; Thu, 3 Apr 2008 13:27:35 +0200 Message-ID: <47F4BF24.7060102@jayway.dk> Date: Thu, 03 Apr 2008 13:27:32 +0200 From: Nino Saturnino Martinez Vazquez Wael User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: users@openjpa.apache.org Subject: Re: JPA and persistence context References: <47F39828.30005@jayway.dk> In-Reply-To: <47F39828.30005@jayway.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org So I guess no one uses OpenJPA in web applications? Only thing I wanted were some snipplets showing how you did transactions etc in a web application. regards Nino Nino Saturnino Martinez Vazquez Wael wrote: > Hi > > I wonder what best practices are on persistence context when running > in a web application(Apache Wicket). Currently my ap are using > extended, since it's the only way it works. But I found out why.. > > When I switch to transaction based after I do changes i need to do > tx.begin tx.commit. > > So if I run via extended my pojo's never gets detached and tx's are > never used? > > And if I use transaction based I need to run a transaction every time > I wish to update? > > I'd like to hear your input and how you do it in your web application? > > BTW I use spring(2.0.1) to manage my entitymanager etc (I have > annotated my daoclass with @transactional) > > regards > -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684