From open-jpa-dev-return-4239-apmail-incubator-open-jpa-dev-archive=incubator.apache.org@incubator.apache.org Wed May 23 00:27:59 2007 Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 69225 invoked from network); 23 May 2007 00:27:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 May 2007 00:27:59 -0000 Received: (qmail 79007 invoked by uid 500); 23 May 2007 00:28:04 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 78981 invoked by uid 500); 23 May 2007 00:28:04 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 78972 invoked by uid 99); 23 May 2007 00:28:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2007 17:28:04 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.18.42.249] (HELO nwk-ea-fw-1.sun.com) (192.18.42.249) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2007 17:27:57 -0700 Received: from d1-sfbay-09.sun.com ([192.18.39.119]) by nwk-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l4N0Ravp014730 for ; Tue, 22 May 2007 17:27:36 -0700 (PDT) Received: from conversion-daemon.d1-sfbay-09.sun.com by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JIG00G01X9CID00@d1-sfbay-09.sun.com> (original mail from Marina.Vatkina@Sun.COM) for open-jpa-dev@incubator.apache.org; Tue, 22 May 2007 17:27:36 -0700 (PDT) Received: from sun.com ([129.150.17.66]) by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JIG00JBYX9Y4770@d1-sfbay-09.sun.com> for open-jpa-dev@incubator.apache.org; Tue, 22 May 2007 17:27:35 -0700 (PDT) Date: Tue, 22 May 2007 17:27:34 -0700 From: Marina Vatkina Subject: Re: How do we know the entity is successfully deployed on appserver In-reply-to: <7262f25e0705221702y2971ecfay9df0d92254c79feb@mail.gmail.com> Sender: Marina.Vatkina@Sun.COM To: open-jpa-dev@incubator.apache.org Message-id: <46538A76.2040603@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=us-ascii Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en References: <89c0c52c0705110656j5991f2a4l37e531ca5939610b@mail.gmail.com> <46537120.4030805@sun.com> <7262f25e0705221702y2971ecfay9df0d92254c79feb@mail.gmail.com> User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20040414 X-Virus-Checked: Checked by ClamAV on apache.org The problem is - unless the user needs to create tables, there is no EM being created on deploy. Even on the load after deploy, the server might choose to do it lazily until the actual access from the user of a component that has an EM injection (or even later when the EM is looked up). If it's the EMF that is injected, then the server will not create an EM at all. Regards, -marina Patrick Linskey wrote: >> It's up to each app server to decide how you can check the deployment >> status. > > > I think it'd be good, though, if OpenJPA had a setting or an API call > to ensure that everything was up and running once the factory was > created. Currently, that API call is: > > emf.createEntityManager().close(); > > It'd be nice at least to provide either a declarative (setting) > approach for that, or an API that does just that but sounds a bit less > hacky. We could then potentially optimize the API at a later time. > > -Patrick > > On 5/22/07, Marina Vatkina wrote: > >> Joshua, >> >> If you deploy an application into an appserver, and your persistence.xml >> contains the openjpa.jdbc.SynchronizeMappings property, the tables >> will be >> created on the 1st emf.createEntityManager() call (or injection of EM >> that does >> the same in the background), i.e. on every redeploy or server restart. >> >> It's up to each app server to decide how you can check the deployment >> status. >> >> Regards, >> -marina >> >> Kevin Sutter wrote: >> > Joshua, >> > Most definitely you can ask user questions on this list. Thanks for >> > posting. >> > >> > OpenJPA provides the ability to autogenerate the database tables at >> runtime >> > via the SynchronizeMappings property in the persistence.xml. Here's an >> > example usage: >> > >> > >> > my.persistence.tests.inheritance.RootEntity >> > my.persistence.tests.inheritance.LeafEntity >> > my.persistence.tests.inheritance.AbstractEntity >> > >> > > > value="org.apache.commons.dbcp.BasicDataSource"/> >> > > > >> value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver >> > >> ,Url=jdbc:derby:target/temp/play/play.test;create=true,MaxActive=100,MaxWait=10000,TestOnBorrow=true"/> >> >> > >> > > > value="buildSchema(ForeignKeys=true)"/> >> > >> > >> > >> > >> > >> > On 5/11/07, Joshua Jackson wrote: >> > >> >> >> >> Dear all, >> >> >> >> How do I know whether an entity is successfully deployed on an >> >> appserver? Usually I detect this by autogenerating tables in database. >> >> Is there anyway I can autogenerate tables in database with OpenJPA? >> >> I've searched in documentation but perhaps I have missed it when >> >> reading it. >> >> >> >> Last but not least, am I allowed to ask user questions in this list? >> >> Since this is a dev list. >> >> >> >> Thanks in advance >> >> >> >> -- >> >> YM!: thejavafreak >> >> Blog: http://www.nagasakti.or.id/roller/joshua/ >> >> >> > >> >> > >