rave-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ate Douma <...@douma.nu>
Subject Re: Reintegrating Model Interfaces Branch
Date Tue, 26 Jun 2012 14:54:42 GMT
On 06/26/2012 04:12 PM, Franklin, Matthew B. wrote:
>
>
> On 6/25/12 3:53 PM, "Franklin, Matthew B." <mfranklin@mitre.org> wrote:
>
>> On 6/25/12 1:11 PM, "Franklin, Matthew B." <mfranklin@mitre.org> wrote:
>>
>>> On 6/25/12 8:33 AM, "Jasha Joachimsthal" <jasha@apache.org> wrote:
>>>
>>>> On 25 June 2012 14:00, Franklin, Matthew B. <mfranklin@mitre.org> wrote:
>>>>
>>>>> On 6/24/12 6:06 AM, "Jasha Joachimsthal" <jasha@apache.org> wrote:
>>>>>
>>>>>> After some debugging I found out that the user creation goes wrong
>>>>> when
>>>>>> the
>>>>>> Page objects are persisted.
>>>>>>
>>>>>> The following pages were created:
>>>>>> Page [id=29] (Person profile)
>>>>>> Page [id=30] (About)
>>>>>> Page [id=31] (My activity)
>>>>>>
>>>>>> On save the following exception enters TranslatedH2Exception:
>>>>>> org.h2.jdbc.JdbcSQLException: Referential integrity constraint
>>>>> violation:
>>>>>> "CONSTRAINT_255A8: PUBLIC.PAGE FOREIGN KEY(PARENT_PAGE_ID) REFERENCES
>>>>>> PUBLIC.PAGE(ENTITY_ID) (29)"; SQL statement:
>>>>>> INSERT INTO page (entity_id, name, page_type, owner_id,
>>>>> page_layout_id,
>>>>>> parent_page_id) VALUES (?, ?, ?, ?, ?, ?) [23506-167]
>>>>>>
>>>>>> The database only contains USER pages after initialization. When
I
>>>>> want to
>>>>>> go to the profile page of an existing user, it fails to generate
the
>>>>>> profile page with exactly the same error.
>>>>>> I'm not able to create a new USER page either, but haven't found
out
>>>>> yet
>>>>>> where that one goes wrong (an NPE somewhere in persisting the Page
>>>>>> object).
>>>>>
>>>>> This appears to be an issue after merging in changes from trunk.  Has
>>>>> anyone checked to see if the issue exists there?
>>>>>
>>>>
>>>> Everything works fine in trunk.
>>>
>>> Figured it out.  The transaction manager applies the save methods to the
>>> entity manager in order and when it was saving the sub pages, it didn't
>>> have the ID for the parent.  I have no idea why this is not failing in
>>> trunk as well, but I added a save call before setting the sub pages and
>>> it
>>> works fine.
>>>
>>> Was this the only issue, or were there other problems you found?
>>
>> Seems that deleting pages is a non-starter. When the changes from trunk
>> were merged in and the constraint generation enabled, OpenJpa can't seem
>> to cascade deletes for page users...
>
> Turns out that in trunk there are a couple of things that were making this
> work:  1) the H2 database was not getting constraints generated for some
> reason.  2) the repositories used to extend AbstractJpaRepository and no
> longer do.  That class was transactional.  Since Spring will run the
> methods in the same transaction that was created at the service layer,
> this posed no problems.  However, there is one key thing that the
> transaction proxy does aside from committing the transaction; flush the
> changes to the database.  I have now added a few flushes in key places and
> everything is working as expected.
>
> Assuming lazy consensus, I will reintegrate the branch into trunk later
> this afternoon.
>
Great work Matt!
+1 for reintegrating back into trunk.

Note: openjpa 2.2.0 adds one new (dist) dependency: asm:asm:jar:3.2:compile
which means we'll have to add its license [1] to our dist LICENSE file.

Regards, Ate

[1] http://asm.ow2.org/asmdex-license.html

Mime
View raw message