Re: Easier strategy to debug "Fail to convert to internal representation"

2009-12-23 Thread Craig L Russell
Hi, Just speaking for myself, it's good practice to capture all the "user domain" information possible in exceptions, logs, and traces. So it's fair to ask that unhelpful exceptions be "dressed" appropriately (to help users figure out what they've done wrong or to identify exactly where t

Easier strategy to debug "Fail to convert to internal representation"

2009-12-23 Thread KARR, DAVID (ATTCINW)
So, I have this big orm.xml that I've been expanding on for the last couple of weeks. I've tested most of the relationships, but I'm sure I've missed some. I had connected a couple more relationships and ran a test, and I got "SQLException: Fail to convert to internal representation". This likel

AUTO: Travis L Rinn is out of the office. (returning 01/04/2010)

2009-12-23 Thread Travis L Rinn
I am out of the office until 01/04/2010. I will respond to your message when I return. Note: This is an automated response to your message "unmanaged exception" sent on 12/23/09 8:42:10. This is the only notification you will receive while this person is away.

Filtering Results of a Mapped Relationship

2009-12-23 Thread baileyby
Is there a way to filter children of a mapped relationship? For example, I have a simple 3-tiered object structure, Person --(OneToOne)--> AddressChain --(OneToMany using a simple 2 column join table)--> Address In the interest of keeping historical data, I use a status column on records in

Re: unmanaged exception

2009-12-23 Thread Daryl Stultz
On Wed, Dec 23, 2009 at 2:03 PM, Craig L Russell wrote: > Hi, > > I surmise that you're using an automatically generated id for "a", > otherwise accessing the id field would not normally trigger a database > access. > Right. > > But I also suspect that the real issue is that the unmanaged entity

Re: unmanaged exception

2009-12-23 Thread Craig L Russell
Hi, I surmise that you're using an automatically generated id for "a", otherwise accessing the id field would not normally trigger a database access. But I also suspect that the real issue is that the unmanaged entity is not being handled properly... Craig On Dec 23, 2009, at 8:01 AM,

Re: How to get hardcoded ordinal values to map to specific Enum values?

2009-12-23 Thread Craig L Russell
Hi, On Dec 23, 2009, at 10:15 AM, Pinaki Poddar wrote: I wish again that OpenJPA or JPA in general had an extension mechanism for the orm.xml. This is something that might be better in XML configuration than annotations. I agree, and I believe this is a major deficiency in the JPA specif

Re: EntityManager dosn't release connection in XA transactions

2009-12-23 Thread Pinaki Poddar
Hi, Looks like the lookup had found something within GlassFish. You can try other variants as follows: Just to cross-check, here are some relevant config 1. 2. You can try a plug-in string to lookup the TM in JNDI (the value is the JNDI name of GlassFish TM as per Google search) 3.

RE: How to get hardcoded ordinal values to map to specific Enum values?

2009-12-23 Thread Pinaki Poddar
> It's unfortunate that you're forced to repeat all the possible enum values and their corresponding int > values. @ExternalValues is a shorthand for @Externalizer and @Factory. Useful when you have handful of values to map. But if the value mapping is complicated or the extent is huge -- then @

Re: FetchGroups and Embeddable Fields

2009-12-23 Thread Pinaki Poddar
> We created a fetch plan that includes a couple of embedded fields and a couple of non-embedded fields. Can you post the exact definition of the plan? Th eplan needs to include the individual fields of the embeddded type. For example, if Person has reference to Address (which is Embeddable) th

Re: FetchGroups and Embeddable Fields

2009-12-23 Thread StevenK
We created an entity that contained some embedded fields and some non-embedded fields (string, ints, etc). All fields are lazy loaded (the default). We created a fetch plan that includes a couple of embedded fields and a couple of non-embedded fields. We then created a query that uses the fetch

Re: unmanaged exception

2009-12-23 Thread Daryl Stultz
On Wed, Dec 23, 2009 at 10:42 AM, Daryl Stultz wrote: > So it seems I should at least not be referencing the id of "a" until after > the commit. > While this may have prevented this particular exception (or maybe it would have happened upon commit anyway), I can't see that referencing the id of

RE: How to get hardcoded ordinal values to map to specific Enum values?

2009-12-23 Thread KARR, DAVID (ATTCINW)
> -Original Message- > From: Pinaki Poddar [mailto:ppod...@apache.org] > Sent: Wednesday, December 23, 2009 6:20 AM > To: users@openjpa.apache.org > Subject: Re: How to get hardcoded ordinal values to map to specific > Enum values? > > > Hi, > The simple way to do this is via @ExternalV

unmanaged exception

2009-12-23 Thread Daryl Stultz
Hello, I occasionally get this exception (meaning it's not repeatable): org.apache.openjpa.persistence.InvalidStateException: Encountered unmanaged object in persistent field "model.EntityA.b" during flush. However, this field does not allow cascade persist. Set the cascade attribute for this fie

Re: COUNT(t) to COUNT(*)

2009-12-23 Thread Pinaki Poddar
Hi, Added to support COUNT(*) for simple queries with a database dictionary option. SVN revision 892947 on trunk. Also see OPENJPA-1440. Use as follows: Mauro Flores wrote: > > The jpql: "SELECT count(o) FROM Object o" (A) > > is usually translated to this sql: "SELECT count(t.primar

Re: FetchGroups and Embeddable Fields

2009-12-23 Thread Pinaki Poddar
> Are their any restrictions, constraints, or other complications that anyone is aware of? Nothing specific comes to mind. Are you seeing any anomaly w.r.t. embedded fields in a fetch plan? StevenK wrote: > > I am trying to optomize a query by using fetch groups. One of the fields > I'd like

Re: How to get hardcoded ordinal values to map to specific Enum values?

2009-12-23 Thread Pinaki Poddar
Hi, The simple way to do this is via @ExternalValues. Unfortunately, @ExternalValues did not support enum types. With latest commit on trunk revision 893504 [1], that support has been added. Here is an example of enum valued field stored as numbers in database. public class Movie { publi

Re: EntityManager dosn't release connection in XA transactions

2009-12-23 Thread is_maximum
Hi Pinaki, I did the code you sent and the returned value is an instance of following class: org.apache.openjpa.ee.RegistryManagedRuntime$TransactionManagerRegistryFacade in which a property of type: _registry = com.sun.enterprise.distributedtx.TransactionSynchronizationRegistryImpl is existed.

Re: EntityManager dosn't release connection in XA transactions

2009-12-23 Thread is_maximum
Hi I'm not sure but I think the SunOne the same GlassFish, Am I right? if yes so there is no problem with that class and if no, How can I implement that? As I can see in the source of AutomaticManagedRuntime there is a SunOneManagedRuntime but I don't know how to detect if the GlassFish is the app

Re: EntityManager dosn't release connection in XA transactions

2009-12-23 Thread Pinaki Poddar
Hi, I had presumed that you had configured OpenJPA for XATransaction with correct configuration as Milosz points out. To verify that OpenJPA is configured correctly to relinquish its transaction management to a external transaction manager, do the following on the injected EntityManager: Open

Re: EntityManager dosn't release connection in XA transactions

2009-12-23 Thread MiƂosz Tylenda
Mohammad, There are a couple of notes on XA transactions in the user manual [1]. Have you tried them? The javadoc of AutomaticManagedRuntime [2] mentions SunONE as supported out-of-the-box but not GlassFish, so you might need to provide your own glue code. Regards, Milosz [1] http://openjpa