openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Teresa Kan" <tck...@gmail.com>
Subject Re: [jira] Commented: (OPENJPA-399) openjpa did not handle multiple schema names with same table name
Date Thu, 11 Oct 2007 17:21:24 GMT
Kevin,

>  Although the datasource uses different schema name, openjpa only created
one table for DOG but not DOG2.

It seems that your code example is dependent on another configuration
somewhere.  Either a persistence.xml or orm.xml that would differentiate the
schema name.  Is that correct?  Your text mentions a "datasource uisng a
different schema name", but I'm not sure what you meant by that.  Basically,
you are saying that attempting to use the same table with different schemas
causes a problem because we are currently not differentiating between tables
with different schemas.  Right?

<tckan> Yes, your interpretation is correct in both questions. The key
problem was that if entities have the schema name declared either thru the
annotation or in the mapping.xml file, then correct tables are created under
each schema. The current implementation worked as design. However, if both
entities use the GeneratedType.AUTO or TABLE, then it won't work with the
current implementation. The cause of the problem is the TableJDBCSeq was
designed as singleton and did not handle different schemas.
<.tckan>

>  Although the datasource uses different schema name, openjpa only created
one table for DOG but not DOG2.

It seems that your code example is dependent on another configuration
somewhere.  Either a persistence.xml or orm.xml that would differentiate the
schema name.  Is that correct?  Your text mentions a "datasource uisng a
different schema name", but I'm not sure what you meant by that.  Basically,
you are saying that attempting to use the same table with different schemas
causes a problem because we are currently not differentiating between tables
with different schemas.  Right?
<tckan> Yes, you are right, It worked as today's implementation. I reviewed
the code in the NativeJDBCSeq and put the similar logic as the TableJDBCSeq
in there. May be I can take those changes out.
</tckan>
<tckan> In terms of documentation, yes, I am working on the documentation
and testcase. Should be posted shortly..
</tckan>

On 10/11/07, Kevin Sutter (JIRA) <jira@apache.org> wrote:
>
>
>    [
> https://issues.apache.org/jira/browse/OPENJPA-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534056]
>
> Kevin Sutter commented on OPENJPA-399:
> --------------------------------------
>
> Teresa,
> I haven't reviewed your patch yet, but I'd like to get some clarification
> on the problem first...
>
> >  Although the datasource uses different schema name, openjpa only
> created one table for DOG but not DOG2.
>
> It seems that your code example is dependent on another configuration
> somewhere.  Either a persistence.xml or orm.xml that would differentiate
> the schema name.  Is that correct?  Your text mentions a "datasource uisng a
> different schema name", but I'm not sure what you meant by that.  Basically,
> you are saying that attempting to use the same table with different schemas
> causes a problem because we are currently not differentiating between tables
> with different schemas.  Right?
>
> >  2) If multiple entities have the generatedType.AUTO, SEQUENCE, TABLE
> for ID and using the same table name, then each entity must have the schema
> name.
>
> Not sure I follow this.  Are you stating the use of different schemas is
> an absolute requirement for id generation?  Or, only if you are interested
> in keeping the id generations separate from each other?  I'm trying to
> figure out what limitations exist under what conditions.
>
> And, your last example with multiple sequence generators...  Did you have
> to change something to allow this to work?  This sounds like normal,
> expected behavior.  Did you fix something in this area?
>
> Finally, as part of the patch, it sounds like you are suggesting some
> documentation updates.  Are you going to include the necessary documentation
> updates to clarify these restrictions?  Since it sounds like we are totally
> broke with some of these scenarios, I'm okay with fixing the problem(s) with
> documentation updates.  But, I don't want to fix something without
> documenting how it's supposed to work for our customers.  Or, how we can
> make it work for our customers.
>
> I'll take a look at your patch next, but I wanted to get started with
> these questions.
>
> Thanks,
> Kevin
>
>
> > openjpa did not handle multiple schema names with same table name
> > -----------------------------------------------------------------
> >
> >                 Key: OPENJPA-399
> >                 URL: https://issues.apache.org/jira/browse/OPENJPA-399
> >             Project: OpenJPA
> >          Issue Type: Bug
> >          Components: jdbc
> >    Affects Versions: 1.0.1
> >         Environment: JDK1.5, OPENJPA verison 580425
> >            Reporter: Teresa Kan
> >         Attachments: OPENJPA_399.patch
> >
> >
> > Two entities have the same table name but with different schema, only
> one table is created. In addition, when two entities use the
> generatedType.AUTO for ID, only one OPENJPA_SEQUENCE-TABLE is created.
> > The problem due to the SchemaGroup.findTable() which only looked for a
> table name from all the schemas. Once the table was found in one of the
> schema then it exited and assumed that the table existed. Same problem in
> the TableJDBCSeq.addSchema().
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

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