Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Eclipselink 1.1.3 choosing the wrong table id generator
Eclipselink 1.1.3 choosing the wrong table id generator [message #534651] Wed, 19 May 2010 13:50 Go to next message
Brett Bergquist is currently offline Brett Bergquist
Messages: 31
Registered: July 2009
Member
I am running eclipselink 1.1.3 and have custom table id generators. From my "orm.xml":

<entity class=" com.canoga.nms.pkg.pkg9145.v1.device.entity.DeviceSummary914 5 ">
<table-generator schema="PKG_9145_V1"
table="ID_GENERATOR"
pk-column-name="SEQ_NAME"
value-column-name="SEQ_COUNT"
name="DEVICESUMMARY_ID_GENERATOR_PKG_9145_V1"
pk-column-value="DEVICESUMMARY_ID"/>
<attributes>
<id name="id">
<generated-value strategy="TABLE" generator="DEVICESUMMARY_ID_GENERATOR_PKG_9145_V1"/>
</id>
</attributes>
</entity>

<entity class="com.canoga.nms.pkg.pkg9161.device.entity.DeviceSummary9161 ">
<table-generator schema="PKG_9161"
table="ID_GENERATOR"
pk-column-name="SEQ_NAME"
value-column-name="SEQ_COUNT"
name="DEVICESUMMARY_ID_GENERATOR_PKG_9161"
pk-column-value="DEVICESUMMARY_ID"/>
<attributes>
<id name="id">
<generated-value strategy="TABLE" generator="DEVICESUMMARY_ID_GENERATOR_PKG_9161"/>
</id>
</attributes>
</entity>

<entity class=" com.canoga.nms.pkg.pkg9145e10g.device.entity.DeviceSummary91 45E10G ">
<table-generator schema="PKG_9145E10G"
table="ID_GENERATOR"
pk-column-name="SEQ_NAME"
value-column-name="SEQ_COUNT"
name="DEVICESUMMARY_ID_GENERATOR_PKG_9145E10G"
pk-column-value="DEVICESUMMARY_ID"/>
<attributes>
<id name="id">
<generated-value strategy="TABLE" generator="DEVICESUMMARY_ID_GENERATOR_PKG_9145E10G"/>
</id>
</attributes>
</entity>

What I am seeing is that Eclipselink is choosing the wrong generator for the
" com.canoga.nms.pkg.pkg9145.v1.device.entity.DeviceSummary914 5 " entity. It is using the generator specified for the
" com.canoga.nms.pkg.pkg9145e10g.device.entity.DeviceSummary91 45E10G " entity. Note that all use the same "pk-column-value" with the
same constant "DEVICESUMMARY_ID". In the log I see displayed:

[#|2010-05-19T10:58:45.187-0400|FINEST|sun-appserver2.1|org. eclipse.persistence.session.file:/C:/package/glassfish/domai ns/domain1/applications/j2ee-apps/csem/csem-core-api.jar-cse m-PU.sequencing|_ThreadID=13;_ThreadName=pool-1-thread-3;Cla ssName=null;MethodName=null;_RequestID=bd27fedc-98e1-4bf4-a1 ad-bc7dc26a0136;|sequence
DEVICESUMMARY_ID: preallocation size 50|#]

Note that I only see this once, not for each entity. So on a whim, I decided to change the "pk-column-value" to be unique for each
entity. Now it chooses the correct one. But I would assume that the table identity information would be chosen based upport the
"generator" value assigned to each id attribute and then from the generator use the correct schema, table, and row. This is not
happening.

Does anyone know why?

Thanks

Brett
Re: Eclipselink 1.1.3 choosing the wrong table id generator [message #534915 is a reply to message #534651] Thu, 20 May 2010 11:51 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Yes, this is a bug in how EclipseLink defines table sequencing. Please log a bug for this issue.

Your workaround to use unique pk-column-value's is correct.


James : Wiki : Book : Blog : Twitter
Re: Eclipselink 1.1.3 choosing the wrong table id generator [message #534945 is a reply to message #534915] Thu, 20 May 2010 14:00 Go to previous messageGo to next message
Brett Bergquist is currently offline Brett Bergquist
Messages: 31
Registered: July 2009
Member
Okay, I wrote the bug up and it was closed as invalid.

My reading of the spec is that the generator "name" attribute is what identifies a generator and that the "generator" attribute of
the "id" attribute is what ties the ID column to the generator. So the name of the generator must be unique and the persistence
provider should use the "schema", "table", "pk-column-name", "value-column-name", and "pk-value-column" attributes of the associated
table-generator specification. I see nothing in the specifications that "pk-value-column"'s value must be unique across all
table-generators.

Could you comment on this? I still believe this is a bug in the implementation.

James wrote:
> Yes, this is a bug in how EclipseLink defines table sequencing. Please
> log a bug for this issue.
>
> Your workaround to use unique pk-column-value's is correct.
>
Re: Eclipselink 1.1.3 choosing the wrong table id generator [message #536936 is a reply to message #534651] Mon, 31 May 2010 10:57 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I believe the bug was reopened, if it is closed, please include the bug #.


James : Wiki : Book : Blog : Twitter
Previous Topic:Disable eclipselink caching and query caching - not working?
Next Topic:Can eclipselink use better table names in its generated sql?
Goto Forum:
  


Current Time: Thu Jul 31 15:47:26 EDT 2014

Powered by FUDForum. Page generated in 0.02435 seconds