Great work Matt. I guess you know all the details about Spring & OpenJPA
now ;)
I don't have time to test all the features, but the integration tests now
pass on my machine.


On 26 June 2012 16:12, Franklin, Matthew B. <[email protected]> wrote:

>
>
> On 6/25/12 3:53 PM, "Franklin, Matthew B." <[email protected]> wrote:
>
> >On 6/25/12 1:11 PM, "Franklin, Matthew B." <[email protected]> wrote:
> >
> >>On 6/25/12 8:33 AM, "Jasha Joachimsthal" <[email protected]> wrote:
> >>
> >>>On 25 June 2012 14:00, Franklin, Matthew B. <[email protected]>
> wrote:
> >>>
> >>>> On 6/24/12 6:06 AM, "Jasha Joachimsthal" <[email protected]> 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.
>
> >
> >
> >>
> >>
> >>>
> >>>
> >>>
> >>>>
> >>>> >
> >>>> >Jasha
> >>>> >
> >>>> >
> >>>> >On 23 June 2012 18:54, Chris Geer <[email protected]> wrote:
> >>>> >
> >>>> >> On Sat, Jun 23, 2012 at 9:36 AM, Chris Geer <[email protected]
> >
> >>>> >>wrote:
> >>>> >>
> >>>> >> > On Sat, Jun 23, 2012 at 6:41 AM, Jasha Joachimsthal
> >>>><[email protected]
> >>>> >> >wrote:
> >>>> >> >
> >>>> >> >> On 21 June 2012 08:30, Jasha Joachimsthal <[email protected]>
> >>>>wrote:
> >>>> >> >>
> >>>> >> >> >
> >>>> >> >> >
> >>>> >> >> > On 20 June 2012 23:26, Ate Douma <[email protected]> wrote:
> >>>> >> >> >
> >>>> >> >> >> On 06/20/2012 10:24 PM, Franklin, Matthew B. wrote:
> >>>> >> >> >>
> >>>> >> >> >>> It looks like all of the tasks for the model interface
> >>>>refactor
> >>>> >>are
> >>>> >> >> >>> completed with the exception of the merging tasks.   I am
> >>>>going
> >>>> >>to
> >>>> >> >> merge
> >>>> >> >> >>> trunk's changes into the branch (RAVE-686).  Once that
> >>>>ticket
> >>>>is
> >>>> >> >> done, it
> >>>> >> >> >>> would be nice to have as many people who can test the branch
> >>>> >>before
> >>>> >> we
> >>>> >> >> >>> merge it back in to trunk.  Is there anyone who can help
> >>>>out?
> >>>> >> >> >>>
> >>>> >> >> >>
> >>>> >> >> >> I don't have time tomorrow but can help test on Friday.
> >>>> >> >> >>
> >>>> >> >> >> Ate
> >>>> >> >> >>
> >>>> >> >> >>
> >>>> >> >> > Same here (more integration test stories are welcome).
> >>>> >> >> >
> >>>> >> >> > Jasha
> >>>> >> >> >
> >>>> >> >>
> >>>> >> >> Creating a new account or provisioning an LDAP account
> >>>>(johnldap)
> >>>>is
> >>>> >> >> broken
> >>>> >> >> in the branch. Both failed in the integration tests (mvn
> >>>> >> >> -Pintegration-tests) and when I do them manually (with a clean
> >>>> >>database)
> >>>> >> >> they fail as well. In trunk this still works. This needs to be
> >>>>fixed
> >>>> >> >> before
> >>>> >> >> the branch is merged into trunk.
> >>>> >> >>
> >>>> >> >> For the new account I get
> >>>> >> >> [INFO] [talledLocalContainer] ERROR:
> >>>> >> >> org.apache.rave.portal.web.controller.NewAccountController -
> >>>>Account
> >>>> >> >> creation failed: Unknown Database Error
> >>>> >> >>
> >>>> >> >> For the LDAP account I get
> >>>> >> >> [WARNING] [talledLocalContainer] java.lang.RuntimeException:
> >>>>Could
> >>>> >>not
> >>>> >> >> bind
> >>>> >> >> LDAP username '{johnldap}' to a user
> >>>> >> >> [WARNING] [talledLocalContainer]        at
> >>>> >> >>
> >>>> >> >>
> >>>> >>
> >>>>
> >>>>>>org.apache.rave.portal.web.security.LdapUserDetailsContextMapper.crea
> >>>>>>t
> >>>>>>e
> >>>>>>Ra
> >>>> >>veUserFromLdapInfo(LdapUserDetailsContextMapper.java:106)
> >>>> >> >> [WARNING] [talledLocalContainer]        at
> >>>> >> >>
> >>>> >> >>
> >>>> >>
> >>>>
> >>>>>>org.apache.rave.portal.web.security.LdapUserDetailsContextMapper.mapU
> >>>>>>s
> >>>>>>e
> >>>>>>rF
> >>>> >>romContext(LdapUserDetailsContextMapper.java:82)
> >>>> >> >> .....
> >>>> >> >> [WARNING] [talledLocalContainer] Caused by:
> >>>> >> >> org.apache.rave.persistence.impl.TranslatedH2Exception: Unknown
> >>>> >>Database
> >>>> >> >> Error
> >>>> >> >> [WARNING] [talledLocalContainer]        at
> >>>> >> >>
> >>>> >> >>
> >>>> >>
> >>>>
> >>>>>>org.apache.rave.persistence.jpa.impl.H2OpenJpaDialect.translateExcept
> >>>>>>i
> >>>>>>o
> >>>>>>nI
> >>>> >>fPossible(H2OpenJpaDialect.java:60)
> >>>> >> >>
> >>>> >> >
> >>>> >> > Just doing a quick test I found a couple issues:
> >>>> >> >
> >>>> >> > 1) I also saw the error Jasha mentioned above when trying to
> >>>>create a
> >>>> >>new
> >>>> >> > user through the UI
> >>>> >> > 2) There is also an error when trying to view anyone's profile
> >>>>page
> >>>> >> >
> >>>> >> > [WARNING] [talledLocalContainer] Jun 23, 2012 9:35:31 AM
> >>>> >> > org.apache.catalina.core.StandardWrapperValve invoke
> >>>> >> > [WARNING] [talledLocalContainer] SEVERE: Servlet.service() for
> >>>>servlet
> >>>> >> > dispatcher threw exception
> >>>> >> > [WARNING] [talledLocalContainer]
> >>>> >> > org.apache.rave.persistence.impl.TranslatedH2Exception: Unknown
> >>>> >>Database
> >>>> >> > Error
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >> >
> >>>> >>
> >>>>
> >>>>>>org.apache.rave.persistence.jpa.impl.H2OpenJpaDialect.translateExcept
> >>>>>>i
> >>>>>>o
> >>>>>>nI
> >>>> >>fPossible(H2OpenJpaDialect.java:60)
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >> >
> >>>> >>
> >>>>
> >>>>>>org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransac
> >>>>>>t
> >>>>>>i
> >>>>>>on
> >>>> >>Manager.java:516)
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >> >
> >>>> >>
> >>>>
> >>>>>>org.springframework.transaction.support.AbstractPlatformTransactionMa
> >>>>>>n
> >>>>>>a
> >>>>>>ge
> >>>> >>r.processCommit(AbstractPlatformTransactionManager.java:754)
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >> >
> >>>> >>
> >>>>
> >>>>>>org.springframework.transaction.support.AbstractPlatformTransactionMa
> >>>>>>n
> >>>>>>a
> >>>>>>ge
> >>>> >>r.commit(AbstractPlatformTransactionManager.java:723)
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >> >
> >>>> >>
> >>>>
> >>>>>>org.springframework.transaction.interceptor.TransactionAspectSupport.
> >>>>>>c
> >>>>>>o
> >>>>>>mm
> >>>> >>itTransactionAfterReturning(TransactionAspectSupport.java:393)
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >> >
> >>>> >>
> >>>>
> >>>>>>
> org.springframework.transaction.interceptor.TransactionInterceptor.in
> >>>>>>v
> >>>>>>o
> >>>>>>ke
> >>>> >>(TransactionInterceptor.java:120)
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >> >
> >>>> >>
> >>>>
> >>>>>>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> >>>>>>R
> >>>>>>e
> >>>>>>fl
> >>>> >>ectiveMethodInvocation.java:172)
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >> >
> >>>> >>
> >>>>
> >>>>>>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
> >>>>>>c
> >>>>>>A
> >>>>>>op
> >>>> >>Proxy.java:202)
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >>$Proxy55.getPersonProfilePage(Unknown
> >>>> >> > Source)
> >>>> >> > [WARNING] [talledLocalContainer] at
> >>>> >> >
> >>>> >>
> >>>>
> >>>>>>org.apache.rave.portal.web.controller.ProfileController.viewProfile(P
> >>>>>>r
> >>>>>>o
> >>>>>>fi
> >>>> >>leController.java:66)
> >>>> >> >
> >>>> >> > Chris
> >>>> >> >
> >>>> >> > One other odd thing, on the model branch, when you create a new
> >>>>tab it
> >>>> >> takes you back to the main tab. Previously it had put you on the
> >>>>newly
> >>>> >> created tab.
> >>>> >>
> >>>> >> Chris
> >>>> >>
> >>>>
> >>>>
> >>
> >>
> >
> >
>
>

Reply via email to