Hi

I have a question about sequence managers and extents. It (was) my
understanding that
a sequence manager sould be able to generate unique IDs across all classes
within an extent.
I have a bunch of classes/interfaces mapped to different tables, which at
the top level has an interface. 
There are several (3) levels below this defined in the repository file. I
would expect for IDs to be generated that were
unique across all tables used to map by hierarchy.
However, I find that on an initial session I can save several instances of
different classes within my inheriance hierarchy (these are at the "second
level")
and the IDs are unique across all tables that should be affected, but when I
try to store some new instances in a later session
(that are at the the second level of inheritance but in a different "branch"
of the inheritance tree) 
then the primary keys start at 1 again. Needless to say this is causing me
problems, and I was wondering if this was a 
known bug -- I am using OJB 0.9.6 on SQL Server 2000.

Here is a snippet from my repository:

<!-- snip -->
   <!-- Extent for all instruments -->
   <!-- TOP LEVEL -->
   <class-descriptor class="com.credittrade.instruments.Instrument">
      <extent-class
class-ref="com.credittrade.instruments.derivatives.InterestRateDerivative"
/>      
      <extent-class class-ref="com.credittrade.instruments.securities.Bond"
/>      
   </class-descriptor>
   
   <!-- Extent for interest rate derivatives -->
   <class-descriptor
class="com.credittrade.instruments.derivatives.InterestRateDerivative">
      <extent-class
class-ref="com.credittrade.instruments.derivatives.Deposit"/>
      <extent-class
class-ref="com.credittrade.instruments.derivatives.IRFuture"/>
      <extent-class
class-ref="com.credittrade.instruments.derivatives.IRSwap"/>   
   </class-descriptor>
   
   <!-- Extent for all bonds -->
   <class-descriptor class="com.credittrade.instruments.securities.Bond">
      <extent-class
class-ref="com.credittrade.instruments.securities.BBGBondModel" />
      <extent-class
class-ref="com.credittrade.instruments.securities.BBGFRNModel" />   
   </class-descriptor>

    <!-- actual definitions for the concrete classes that make up the
extents -->
<!-- end snip -->

On the initial session I am storing instances of the classes defined in the
extent for the InterestRateDerivative class. IDs are generated
correctly across the 3 tables affected.

On the latter session I am storing instances of classes defined in the
extent for the Bond class. IDs are reinitialised at 1.
I would have expected that the IDs would start at (or just after depending
on grab size and number of things saved) the last generated
in the previous session.


Many thanks

Mark Rowell

----------------------------------------------------------------
Mark Rowell
CreditTrade

T: +44 (020) 7400 5078
M: mailto:[EMAIL PROTECTED]

CreditTrade Limited is regulated by the FSA. (c) CreditTrade 2002. All rights 
reserved. The information and data contained in this email is provided for the 
information purposes of the addressee only and should not be reproduced and/or 
distributed to any other person. It is provided without any warranty whatsoever and 
unless stated otherwise consists purely of indicative market prices and other 
information.

Any opinion or comments expressed or assumption made in association with the data or 
information provided in this email is a reflection of CreditTrades judgement at the 
time of compiling the data and is subject to change. CreditTrade hereby makes no 
representation and accepts no responsibility or liability as to the completeness or 
accuracy of this email.

The content of this email is not intended as an offer or solicitation for, or 
recommendation of, the purchase or sale of any financial instrument, or as an official 
confirmation of any transaction, and should not be construed as investment advice.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to