openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Bauer <techhu...@gmail.com>
Subject Re: OneToMany cascading persist and sequence ID generator
Date Wed, 02 Mar 2011 20:42:44 GMT
Hi Phill,

I tried a similar configuration, but was unable to reproduce the failure.
Since cascade is defined on the Lead-side of the relationship, I'm assuming
that you are persisting the Lead entity, right?  I'm also assuming that
you've set all bi-directional references in your code.  ie
answer.setLead(lead), lead.setAnswers(answers).  If both of those
assumptions are correct, the next step would be to provide an OpenJPA trace
using:

<property name="openjpa.Log" value="DefaultLevel=TRACE"/>

please enable parameter value trace as well using:

<property name="openjpa.ConnectionFactoryProperties"
value="PrintParameters=true"/>

That may help us spot the problem.  Or, if possible, please provide a simple
test that can be used to reproduce the problem.

-Jeremy

On Wed, Mar 2, 2011 at 11:08 AM, Phill <phill@bicispace.com> wrote:

> Yes it also uses a sequence generator.
>
> SurveyAnswer.java
>
> @SequenceGenerator(name = "Survey_Result_Id_Gen", sequenceName =
> "survey_result_seq", allocationSize = 10)
>
> @Id
> @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
> "Survey_Result_Id_Gen")
> @Column(name = "result_id")
> protected long id;
>
>
> On 02/mar/2011, at 17.24, Jeremy Bauer wrote:
>
> > Thanks, Phill.  Sorry, I forgot to ask - does SurveyAnswer also use the
> same
> > id generation strategy as Lead?  In the meantime, I'll begin trying to
> > reproduce the failure you are seeing.
> >
> > -Jeremy
> >
> > On Wed, Mar 2, 2011 at 9:26 AM, Phill <phill@bicispace.com> wrote:
> >
> >> OpenJPA 2.1.0 and PostgreSQL 9
> >> I have separate DDL.
> >> Phill
> >>
> >>
> >> On 02/mar/2011, at 16.22, Jeremy Bauer wrote:
> >>
> >>> Hi Phill,
> >>>
> >>> What database and version of OpenJPA are you using?  Also, does OpenJPA
> >>> generate the tables or do you have separate DDL?
> >>>
> >>> -Jeremy
>

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