openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin S Vera-Tudela <bveratud...@us.ibm.com>
Subject Re: OpenJPA Relationships Question
Date Fri, 09 Oct 2009 16:53:30 GMT

@Daryl,

Yes, it works sometimes (very seldom). In my code I create Class2 first and
then create the Relationship. I suppose you suggest I do it the other way
around? I will try that.

Also, the @ForeignKey annotation should go in the Relationship class right?
Let me know. I can make changes now.

Thanks,.



Benjamin S. Vera-Tudela
SWG Middleware Strategy
Ph: (512)-286-9073 T/L 363-9073
E-Mail: bveratudela@us.ibm.com


|------------>
| From:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Daryl Stultz <daryl@6degrees.com>                                               
                                                                 |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |users@openjpa.apache.org                                                              
                                                           |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |10/09/2009 11:49 AM                                                                   
                                                           |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: OpenJPA Relationships Question                                                    
                                                           |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|





On Fri, Oct 9, 2009 at 12:41 PM, Benjamin S Vera-Tudela <
bveratudela@us.ibm.com> wrote:

> Hi ....
>
> I am having a problem with the createRelationship method at the time of
> committing the transaction where the database (DB2) throws error 23503
(see
> below for error details).
>
> I am not sure if the problem is related to 1) the order of my persist
calls
> within the transaction (see TransactionManager class in MyDataAppRDB);
>
I don't believe this matters, queries are issued at commit time. I didn't
fully analyze your case but it looks like the child row is being inserted
before the parent. Does it happen every time? If it succeeds once in a
while, it's a query ordering issue. You might try annotating the FK
columns/fields with @ForeignKey.

--
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com:


Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message