ID field auto generation issue for multiple databases supporting

2009-06-11 Thread wang yu
Hello, I found If I user derby, I need to use @GeneratedValue(strategy=GenerationType.IDENTITY) for ID field. And for oracle database, I need to use @GeneratedValue(strategy=GenerationType.SEQUENCE). The question is if I want to use same entity classes to support both derby and oracle, how should

[ANNOUNCE] OpenJPA Logo Contest

2009-06-11 Thread Donald Woods
Announcing the OpenJPA Logo Contest! Submissions: Accepted now through June 30, 2009 Rules and Guidelines: See the Logo Contest page [1] for more details. Voting: Will occur from July 1 through July 14. Winner: Will be announced on or after July 15. [1]

Use getters/setters only

2009-06-11 Thread Daryl Stultz
I seem to remember somewhere reading that one should use getters and setters only when accessing persistent fields. This seems obvious from outside the entity class, but not so obvious from inside. Can anyone point me to the manual or other resource that describes this or explain it here? Thanks.

Bad value for type BigDecimal : Y

2009-06-11 Thread Ashish Jain
Hi All, I am using apache geronimo v2.1.4 which is bundled with openJPA 1.2.1 and postgresql 8.5.3. while running an applicaiton which is based on JSF and EJB's I get the following error. 2009-06-11 16:19:58,417 TRACE [Runtime] An exception occurred while ending the transaction. This exception

Re: Bad value for type BigDecimal : Y

2009-06-11 Thread Donald Woods
Can you provide more details on the Stockingpoint entity being used, like the orm.xml or annotations? -Donald Ashish Jain wrote: Hi All, I am using apache geronimo v2.1.4 which is bundled with openJPA 1.2.1 and postgresql 8.5.3. while running an applicaiton which is based on JSF and EJB's

Strange behavior with a distributed transaction

2009-06-11 Thread devu213
Hi, I have a scenario where I'm trying to run a distributed transaction across two websphere 6.1 app servers on two different nodes (2 physical machines). A stateless session bean on server 1 makes an entry to a table in the database after which it calls the remote ejb on server 2 which again

Need to list embeddable classes in persistence.xml?

2009-06-11 Thread Laird Nelson
Hello. I've found that OpenJPA needs me to list my @Embeddable classes in persistence.xml as well as my @Entity classes. This is not needed by Hibernate or EclipseLink. I couldn't find a relevant section of the specification that addresses this. Is this a bug or just a minor annoyance? I'm

Re: Use getters/setters only

2009-06-11 Thread Simon Droscher
This section of the OpenJPA manual describes this: http://openjpa.apache.org/builds/1.2.1/apache-openjpa-1.2.1/docs/manual/manual.html#jpa_overview_meta_field The major point it makes is this: When using property access, only the getter and setter method for a property should ever access the

Re: Strange behavior with a distributed transaction

2009-06-11 Thread Michael Dick
Sounds like DB2 is getting an exclusive lock on the row when you do the first find. WebSphere's default isolation level is RR which will obtain long lived locks. Unfortunately it isn't always easy to change the default in WebSphere. The recommended way is to create a resource reference in your

Re: Use getters/setters only

2009-06-11 Thread Daryl Stultz
On Thu, Jun 11, 2009 at 2:20 PM, Simon Droscher simon.drosc...@elasticpath.com wrote: The major point it makes is this: When using property access, only the getter and setter method for a property should ever access the underlying persistent field directly That's exactly what I was

Re: Strange behavior with a distributed transaction

2009-06-11 Thread devu213
Thanks Michael. However, I forgot to mention this: I also tried swapping the two find calls i.e do a find for the entity persisted on the remote server first and then try and do a find for the entity on the local server. This time it hangs on the first call itself i.e the output now is: On

Re: Bad value for type BigDecimal : Y

2009-06-11 Thread Ashish Jain
Hi Donald, There is no associated orm.xml in the applicaiton.Annotations in Stockingpoint entity are @Table, @NamedQueries, @ManyToOne @JoinColumn, @Temporal Thanks Ashish On Thu, Jun 11, 2009 at 10:26 PM, Donald Woods dwo...@apache.org wrote: Can you provide more details on the Stockingpoint