Re: How to get database information

2009-07-09 Thread Jeremy Bauer
Martin, The OpenJPAEntityManagerSPI interface provides a method to access the underlying JDBC connection used by the em. You can use that connection to get db metadata information. Depending on whether your application uses a container or application managed em, you may need to call em.getDelega

Re: org.apache.openjpa.util.UserException - ConnectionDriverName

2009-07-09 Thread Michael Dick
Hi Annette, It looks like OpenJPA tried to lookup java:comp/jdbc/selektionendb and failed. I think the usual namespace is java:comp/*env*/. You might just be missing 'env' in persistence.xml. hope this helps, -mike On Thu, Jul 9, 2009 at 7:56 AM, Scherer, Annette < annette.sche...@huk-coburg.de

Re: correct way to load persistent metadata at startup

2009-07-09 Thread Rick Curtis
Simon - I started looking at the patch you attached to OPENJPA-250 today and I'm wondering if you had to make any additional changes to get it working properly in your environment? I applied the patch and I ran a fairly simple scenario with a number of threads going and I ran into some issues whe

Re: Define index?

2009-07-09 Thread ljnelson
Thank you! Yes, you have; I went right by it. Thanks again. Best, Laird On Thu, Jul 9, 2009 at 2:36 PM, Michael Dick (via Nabble) < ml-user+17961-1519918...@n2.nabble.com > wrote: > Hi Laird > > I forgot to add this bit, it *is* in the manual, but it's easier to find > once you know what you'

Re: Define index?

2009-07-09 Thread Michael Dick
Hi Laird I forgot to add this bit, it *is* in the manual, but it's easier to find once you know what you're looking for. Link to the relevant section : http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_jpa_constraints It's something we can expand on though, maybe

Re: Define index?

2009-07-09 Thread Michael Dick
I think you're looking for the org.apache.openjpa.persistence.jdbc.Index annotation : ex : import org.apache.openjpa.persistence.jdbc.Index; @Entity public class Person { . . . @Index private int myint; . . . } SQL generation (DB2) : 3786 laird TRACE [main] openjpa.jdbc.SQL -

Re: How to get database information

2009-07-09 Thread Michael Dick
Hi Martin Unfortunately there isn't an easy way (at least not one that I'm aware of). If you're specifying the connection info in properties in your persistence.xml file then we can retrieve those values. If you're using a WebSphere datasource then it's trickier, all we have access to is the cont

Re: null values not updating

2009-07-09 Thread mjdenham
I hit this problem a couple of months ago and discovered it happens if you serialize the object because the serialize/deserialize process seems to lose track of null values. There is an openjpa setting which fixes this but my problem was that I mistakenly had a remote interface to my ejb instead

Define index?

2009-07-09 Thread Laird Nelson
Is it possible to define a non-unique index in OpenJPA? Hibernate offers the @Index annotation to do this as part of its DDL generation machinery. My apologies if this was mentioned; I didn't see it in http://openjpa.apache.org/builds/latest/docs/manual/manual.html. Thanks, Laird

Re: NPE at org.apache.openjpa.jdbc.meta.MappingInfo.mergeJoinColumn(MappingInfo.java:1400)

2009-07-09 Thread Martin Dirichs
Hello Yann, this seems to be a flaw in the OpenJPA mapping source indeed. I just got the same error here with the 2.0.0-M2 version (its line 1473 in org.apache.openjpa.jdbc.meta.MappingInfo.java there). The error occurred after introducing a trivial change in the domain model. Looking at the sou

Re: Memory Usage

2009-07-09 Thread Darren Senel
Hello again, We are still trying to trouble shoot our memory leak. It seems that other users have had the same issue. https://issues.apache.org/jira/browse/OPENJPA-746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel JIRA-746 Are there any updates on this issue that could hel

How to get database information

2009-07-09 Thread mjdenham
Hi, Is there an easy way to dynamically find the database name and schema name being used by an EntityManager at runtime? We are using OpenJpa 1.0.4 on Websphere and an Oracle datasource. We would like to make the information accessible on an application screen because we have so many environme

Re: Close database connection

2009-07-09 Thread Michael Dick
Hi Annette, I think on-demand is the default value for ConnectionRetainMode, so you *shouldn't* need to set the property. I don't see how it could hurt though. Making sure you close the em before it goes out of scope is definitely a good idea (same would go for the EntityManagerFactory, but that

Unmanaged Entity failure on persist

2009-07-09 Thread Daryl Stultz
I've just deployed by first OpenJPA to a live production system. I'm getting an occasional error: InvalidStateException: Encountered unmanaged object in persistent field > "blah.MyEntity.addedBy" during flush. However, this field does not allow > cascade persist. Set the cascade attribute for thi

AW: Close database connection

2009-07-09 Thread Scherer, Annette
Hello Michael, Thank you for your tip. I think, I do not use em.close() after very each operation on DB Should I additionally configure the ConnectionRetainMode property in my persistence.xml (Suppose not, for on-demand is the default configuration for ConnectionRetainMode) Actual version

org.apache.openjpa.util.UserException - ConnectionDriverName

2009-07-09 Thread Scherer, Annette
Hello, I have a problem, when trying to create an EntityManager. I'm using the persistence.xml beneath, which indicates to use managed transactions and managed ConnectionFactoryMode (see below). http://java.sun.com/xml/ns/persistence"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instan