You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Christian Eugster <ch...@bluewin.ch> on 2004/06/08 11:01:15 UTC

Can not init Identity for given object

Hi!

I meet a problem using ojb 1.0rc5 and mysql (innodb): when i try to insert
an object with some children  in a concurrent environment a
ClassNotPersistenceCapableException is thrown if some other clients are
doing the same (See the stacktrace below).

What am I doing wrong? Has anybody experienced the same and solved it (and:
how)?

Thank you for answering?

Stacktrace:
INFO: Beleg wird gespeichert...
08.06.2004 08:14:16 ch.eugster.pos.db.Table describeError
SCHWERWIEGEND: Can not init Identity for given object
ch.eugster.pos.db.Position@8ca8ac
org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: Can not
init Identity for given
object ch.eugster.pos.db.Position@8ca8ac
        at org.apache.ojb.broker.Identity.init(Unknown Source)
        at org.apache.ojb.broker.Identity.<init>(Unknown Source)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollectionObject(Unkno
wn Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollections(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
        at ch.eugster.pos.db.Table.store(Table.java:119)
        at ch.eugster.pos.db.Table.store(Table.java:215)
        at
ch.eugster.pos.client.model.ReceiptModel.storeReceipt(ReceiptModel.java:313)
        at
ch.eugster.pos.client.model.ReceiptModel.posEventPerformed(ReceiptModel.java
:210)
        at
ch.eugster.pos.client.event.Action.actionPerformed(Action.java:114)
        at
ch.eugster.pos.client.event.StoreReceiptAction.actionPerformed(StoreReceiptA
ction.java:85
)
        at
ch.eugster.pos.client.event.ExpressStoreReceiptAction.actionPerformed(Expres
sStoreReceipt
Action.java:99)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: org.apache.ojb.broker.PersistenceBrokerException: Could not get
key value
        at
org.apache.ojb.broker.util.BrokerHelper.getAutoIncrementValue(Unknown
Source)
        at
org.apache.ojb.broker.util.BrokerHelper.getValuesForObject(Unknown Source)
        at org.apache.ojb.broker.util.BrokerHelper.getKeyValues(Unknown
Source)
        ... 40 more
Caused by: org.apache.ojb.broker.util.sequence.SequenceManagerException:
Can't build new sequence
        at
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.getSequence(U
nknown Source
)
        at
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueLong
(Unknown Sour
ce)
        at
org.apache.ojb.broker.util.sequence.AbstractSequenceManager.getUniqueValue(U
nknown Source
)
        ... 43 more
Caused by: org.apache.ojb.broker.OptimisticLockException: Object has been
modified by someone else
        at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
        at
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
quence(Unknow
n Source)
        at
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
quence(Unknow
n Source)
        at
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
quence(Unknow
n Source)
        at
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
quence(Unknow
n Source)
        at
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
quence(Unknow
n Source)
        at
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
quence(Unknow
n Source)
        ... 46 more


the used classes are (class-descriptors)
Receipt:
<class-descriptor class="ch.eugster.pos.db.Receipt" table="pos_receipt"
isolation-level="read-uncommitted" accept-locks="true" refresh="false">
    <field-descriptor name="id" column="id" jdbc-type="BIGINT"
primarykey="true" indexed="true" access="readwrite" autoincrement="true"
nullable="true" locking="false" update-lock="true" default-fetch="false" />
    <field-descriptor name="timestamp" column="timestamp"
jdbc-type="TIMESTAMP" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="number" column="number" indexed="true"
jdbc-type="VARCHAR" length="25" primarykey="false" nullable="true"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="transactionId" column="transaction_id"
jdbc-type="BIGINT" primarykey="false" indexed="true" access="readwrite"
autoincrement="false" nullable="false" locking="false" update-lock="true"
default-fetch="false" />
    <field-descriptor name="bookingId" column="booking_id"
jdbc-type="BIGINT" primarykey="false" indexed="true" access="readwrite"
autoincrement="false" nullable="false" locking="false" update-lock="true"
default-fetch="false" />
    <field-descriptor name="salespointId" column="salespoint_id"
jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="userId" column="user_id" jdbc-type="BIGINT"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="foreignCurrencyId" column="foreign_currency_id"
jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="status" column="status" jdbc-type="INTEGER"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="settlement" column="settlement"
jdbc-type="BIGINT" primarykey="false" indexed="true" nullable="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="amount" column="amount" jdbc-type="DOUBLE"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="payment" column="payment" jdbc-type="DOUBLE"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="paymentFC" column="payment_fc"
jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />

    <reference-descriptor name="salespoint"
class-ref="ch.eugster.pos.db.Salespoint" proxy="false" refresh="false"
auto-retrieve="true" auto-update="false" auto-delete="false"
otm-dependent="false">
   	 	<foreignkey field-ref="salespointId" />
    </reference-descriptor>

    <reference-descriptor name="user" class-ref="ch.eugster.pos.db.User"
proxy="false" refresh="false" auto-retrieve="true" auto-update="false"
auto-delete="false" otm-dependent="false">
   	 	<foreignkey field-ref="userId" />
    </reference-descriptor>

    <reference-descriptor name="foreignCurrency"
class-ref="ch.eugster.pos.db.ForeignCurrency" proxy="false" refresh="false"
auto-retrieve="true" auto-update="false" auto-delete="false"
otm-dependent="false">
   	 	<foreignkey field-ref="foreignCurrencyId" />
    </reference-descriptor>

    <collection-descriptor name="positions"
element-class-ref="ch.eugster.pos.db.Position" auto-retrieve="true"
auto-update="true" auto-delete="true" sort="ASC" proxy="false"
refresh="false" otm-dependent="false">
	   	<orderby name="id" sort="ASC" />
    	<inverse-foreignkey field-ref="receiptId" />
    </collection-descriptor>

    <collection-descriptor name="payments"
element-class-ref="ch.eugster.pos.db.Payment" auto-retrieve="true"
auto-update="true" auto-delete="true" sort="ASC" proxy="false"
refresh="false" otm-dependent="false">
	   	<orderby name="id" sort="ASC" />
	   	<inverse-foreignkey field-ref="receiptId" />
    </collection-descriptor>
</class-descriptor>

Position:
<class-descriptor class="ch.eugster.pos.db.Position" table="pos_position"
isolation-level="read-uncommitted" accept-locks="true" refresh="false">
    <field-descriptor name="id" column="id" jdbc-type="BIGINT"
primarykey="true" indexed="true" access="readwrite" autoincrement="true"
nullable="true" locking="false" update-lock="true" default-fetch="false" />
    <field-descriptor name="receiptId" column="receipt_id"
jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="productId" column="product_id"
jdbc-type="VARCHAR" length="50" primarykey="false" nullable="true"
indexed="false" autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="productGroupId" column="product_group_id"
jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="currentTaxId" column="current_tax_id"
jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="quantity" column="quantity" jdbc-type="INTEGER"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="price" column="price" jdbc-type="DOUBLE"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="discount" column="discount" jdbc-type="DOUBLE"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="expense" column="expense" jdbc-type="BIT"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="galileoBook" column="galileo_book"
jdbc-type="BIT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="galileoBooked" column="galileo_booked"
jdbc-type="BIT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="optCode" column="opt_code" jdbc-type="CHAR"
length="1" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="author" column="author" jdbc-type="VARCHAR"
length="100" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="title" column="title" jdbc-type="VARCHAR"
length="100" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="publisher" column="publisher"
jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true"
indexed="false" autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="isbn" column="isbn" jdbc-type="VARCHAR"
length="13" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="bznr" column="bznr" jdbc-type="VARCHAR"
length="10" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="productNumber" column="product_number"
jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true"
indexed="false" autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="ordered" column="ordered" jdbc-type="BIT"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="orderId" column="order_id" jdbc-type="VARCHAR"
length="100" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />

    <reference-descriptor name="receipt"
class-ref="ch.eugster.pos.db.Receipt" proxy="false" refresh="false"
auto-retrieve="true" auto-update="false" auto-delete="false"
otm-dependent="false">
   	 	<foreignkey field-ref="receiptId" />
    </reference-descriptor>

    <reference-descriptor name="productGroup"
class-ref="ch.eugster.pos.db.ProductGroup" proxy="false" refresh="false"
auto-retrieve="true" auto-update="false" auto-delete="false"
otm-dependent="false">
   	 	<foreignkey field-ref="productGroupId" />
    </reference-descriptor>

    <reference-descriptor name="currentTax"
class-ref="ch.eugster.pos.db.CurrentTax" proxy="false" refresh="false"
auto-retrieve="true" auto-update="false" auto-delete="false"
otm-dependent="false">
   	 	<foreignkey field-ref="currentTaxId" />
    </reference-descriptor>

</class-descriptor>

Payment:
<class-descriptor class="ch.eugster.pos.db.Payment" table="pos_payment"
isolation-level="read-uncommitted" accept-locks="true" refresh="false">
    <field-descriptor name="id" column="id" jdbc-type="BIGINT"
primarykey="true" indexed="true" access="readwrite" autoincrement="true"
nullable="true" locking="false" update-lock="true" default-fetch="false" />
    <field-descriptor name="receiptId" column="receipt_id"
jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="paymentTypeId" column="payment_type_id"
jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="foreignCurrencyId" column="foreign_currency_id"
jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="quotation" column="quotation" jdbc-type="DOUBLE"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="amount" column="amount" jdbc-type="DOUBLE"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="amountFC" column="amount_fc" jdbc-type="DOUBLE"
primarykey="false" nullable="true" indexed="false" autoincrement="false"
locking="false" update-lock="true" default-fetch="false" access="readwrite"
/>
    <field-descriptor name="roundFactor" column="round_factor"
jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />
    <field-descriptor name="roundFactorFC" column="round_factor_fc"
jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
autoincrement="false" locking="false" update-lock="true"
default-fetch="false" access="readwrite" />

    <reference-descriptor name="receipt"
class-ref="ch.eugster.pos.db.Receipt" proxy="false" refresh="false"
auto-retrieve="true" auto-update="false" auto-delete="false"
otm-dependent="false">
   	 	<foreignkey field-ref="receiptId" />
    </reference-descriptor>

    <reference-descriptor name="paymentType"
class-ref="ch.eugster.pos.db.PaymentType" proxy="false" refresh="false"
auto-retrieve="true" auto-update="false" auto-delete="false"
otm-dependent="false">
   	 	<foreignkey field-ref="paymentTypeId" />
    </reference-descriptor>

    <reference-descriptor name="foreignCurrency"
class-ref="ch.eugster.pos.db.ForeignCurrency" proxy="false" refresh="false"
auto-retrieve="true" auto-update="false" auto-delete="false"
otm-dependent="false">
   	 	<foreignkey field-ref="foreignCurrencyId" />
    </reference-descriptor>

</class-descriptor>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


transaction spanning multiple methods

Posted by dennis bekkering <dj...@hotmail.com>.
Hello,

I have a general question about use of transactions , i am not really
confidend in this area. I have delegate classes to store and get objects
from the database. eg

ContactDelegate.storeContact() and
MailDelegate.storeMail() and so on ...

I like to reuse those methods and dont want to write a method for every
possible storing sequence.In a certain case  i like to store the contact
only if the mail was stored without any problems. In an other case i just
like to store the mail. I cannot begin the transaction in the methods
because it would not be one transaction if i call the methods one after the
other. I have got the feeling that i 'am asking a really stupid question but
i have got a hard time finding a good solution for my need.

regards,
Dennis


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: joining

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi dennis,

you could try 'or-ing' the criteria for the 3 lists:

Criteria to = new Criteria();
Criteria cc = new Criteria();
Criteria bcc = new Criteria();


QueryByCriteria q;
Collection result;

// get all mails for contact 123
Integer id = new Integer(123);
to.addEqualTo("toList.id", id);
cc.addEqualTo("ccList.id", id);
bcc.addEqualTo("bccList.id", id);

to.addOrCriteria(cc);
to.addOrCriteria(bcc);

q = QueryFactory.newQuery(Mail.class, to, true);
result = broker.getCollectionByQuery(q);

i havn't tried it, but i think it should work ;)
btw. the field-descriptor no longer needs an id (as you still use in contact)

jakob

dennis bekkering wrote:
> Jakob,
> 
> Thank you for your reacttion. The Contact descriptor =
> 
> <class-descriptor class="nl.salesmakers.model.Contact" table="Contact">
>   <field-descriptor id="30" name="dateOfBirth" column="dateofbirth"
> jdbc-type="DATE"/>
>   <field-descriptor id="31" name="email" column="email"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="32" name="gender" column="gender"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="33" name="mobilePhone" column="mobilephone"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="34" name="firstName" column="firstname"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="35" name="title" column="title"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="35" name="type" column="type" jdbc-type="VARCHAR"/>
>   <field-descriptor id="36" name="companyId" column="companyid"
> jdbc-type="INTEGER"/>
>   <field-descriptor id="37" name="function" column="function"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="39" name="middleName" column="middlename"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="40" name="initials" column="initials"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="41" name="phone" column="phone"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="42" name="id" column="id" jdbc-type="INTEGER"
> primarykey="true" autoincrement="true"/>
>   <field-descriptor id="43" name="lastName" column="lastname"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="44" name="creationDate" column="creationdate"
> jdbc-type="DATE"/>
>   <field-descriptor id="45" name="searchName" column="searchname"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="46" name="privat" column="privat"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="47" name="userId" column="userid"
> jdbc-type="INTEGER"/>
>   <field-descriptor id="48" name="mailFooter" column="mailfooter"
> jdbc-type="VARCHAR"/>
>   <field-descriptor id="49" name="mailHeader" column="mailheader"
> jdbc-type="VARCHAR"/>
>   <reference-descriptor name="user" class-ref="nl.salesmakers.model.User">
>     <foreignkey field-ref="userId"/>
>   </reference-descriptor>
>   <reference-descriptor name="company"
> class-ref="nl.salesmakers.model.Company">
>     <foreignkey field-ref="companyId"/>
>   </reference-descriptor>
>   <field-descriptor name="online" column="online" jdbc-type="INTEGER"/>
> </class-descriptor>
> 
> Dennis
> 
> ----- Original Message ----- 
> From: "Jakob Braeuchi" <jb...@gmx.ch>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Wednesday, June 09, 2004 9:39 PM
> Subject: Re: joining
> 
> 
> 
>>hi dennis,
>>
>>how does the classdescriptor for Contact look ?
>>
>>jakob
>>
>>dennis bekkering wrote:
>>
>>
>>>Hello,
>>>
>>>I have class Mail with some collections that return contacts.
>>>
>>>public class Mail
>>>{
>>> private Collection attachementList = new ArrayList();
>>> private Collection bccList = new ArrayList();
>>> private Collection ccList = new ArrayList();
>>> private Collection toList = new ArrayList();
>>>........
>>> }
>>>
>>>descriptor :
>>>
>>>  <collection-descriptor name="toList"
>>>element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
>>>auto-update="true" auto-delete="false"
> 
> indirection-table="MailTo2Contact">
> 
>>>    <fk-pointing-to-this-class column="mailid"/>
>>>    <fk-pointing-to-element-class column="contactId"/>
>>>  </collection-descriptor>
>>>  <collection-descriptor name="ccList"
>>>element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
>>>auto-update="true" auto-delete="false"
> 
> indirection-table="MailCc2Contact">
> 
>>>    <fk-pointing-to-this-class column="mailid"/>
>>>    <fk-pointing-to-element-class column="contactId"/>
>>>  </collection-descriptor>
>>>  <collection-descriptor name="bccList"
>>>element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
>>>auto-update="true" auto-delete="false"
> 
> indirection-table="MailBcc2Contact">
> 
>>>    <fk-pointing-to-this-class column="mailid"/>
>>>    <fk-pointing-to-element-class column="contactId"/>
>>>  </collection-descriptor>
>>>
>>>
>>>My sql query for getting all mail messages send to a certain contact :
>>>
>>>" SELECT distinct m.* " +
>>> " FROM " +
>>>      " Mail m , " +
>>>      " Contact c , " +
>>>      " MailTo2Contact mtc ," +
>>>      " MailCc2Contact mcc ," +
>>>      " MailBcc2Contact mbc " +
>>> " WHERE " +
>>>       " (( m.id = mtc.mailid" +
>>>           " AND" +
>>>       " c.id = mtc.contactid )" +
>>>  " OR " +
>>>       " (m.id = mcc.mailid" +
>>>           " AND" +
>>>       " c.id = mcc.contactid )" +
>>>  " OR " +
>>>       " (m.id = mbc.mailid" +
>>>           " AND" +
>>>       " mbc.contactid = c.id   ))" +
>>>  " AND " +
>>>      " c.id = " + contact.getId() +
>>>  " AND " +
>>>      " m.flag = 'sent'" +
>>>  " order by m.date desc"    +
>>>  "";
>>>
>>>I offcourse would like to use the pb API but dont know how. Any hints? I
>>>cannot use select in , since mysql 4.0 does not support them and 4.1 is
> 
> not
> 
>>>in production.
>>>
>>>regards,
>>>Dennis
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: joining

Posted by dennis bekkering <dj...@hotmail.com>.
Jakob,

Thank you for your reacttion. The Contact descriptor =

<class-descriptor class="nl.salesmakers.model.Contact" table="Contact">
  <field-descriptor id="30" name="dateOfBirth" column="dateofbirth"
jdbc-type="DATE"/>
  <field-descriptor id="31" name="email" column="email"
jdbc-type="VARCHAR"/>
  <field-descriptor id="32" name="gender" column="gender"
jdbc-type="VARCHAR"/>
  <field-descriptor id="33" name="mobilePhone" column="mobilephone"
jdbc-type="VARCHAR"/>
  <field-descriptor id="34" name="firstName" column="firstname"
jdbc-type="VARCHAR"/>
  <field-descriptor id="35" name="title" column="title"
jdbc-type="VARCHAR"/>
  <field-descriptor id="35" name="type" column="type" jdbc-type="VARCHAR"/>
  <field-descriptor id="36" name="companyId" column="companyid"
jdbc-type="INTEGER"/>
  <field-descriptor id="37" name="function" column="function"
jdbc-type="VARCHAR"/>
  <field-descriptor id="39" name="middleName" column="middlename"
jdbc-type="VARCHAR"/>
  <field-descriptor id="40" name="initials" column="initials"
jdbc-type="VARCHAR"/>
  <field-descriptor id="41" name="phone" column="phone"
jdbc-type="VARCHAR"/>
  <field-descriptor id="42" name="id" column="id" jdbc-type="INTEGER"
primarykey="true" autoincrement="true"/>
  <field-descriptor id="43" name="lastName" column="lastname"
jdbc-type="VARCHAR"/>
  <field-descriptor id="44" name="creationDate" column="creationdate"
jdbc-type="DATE"/>
  <field-descriptor id="45" name="searchName" column="searchname"
jdbc-type="VARCHAR"/>
  <field-descriptor id="46" name="privat" column="privat"
jdbc-type="VARCHAR"/>
  <field-descriptor id="47" name="userId" column="userid"
jdbc-type="INTEGER"/>
  <field-descriptor id="48" name="mailFooter" column="mailfooter"
jdbc-type="VARCHAR"/>
  <field-descriptor id="49" name="mailHeader" column="mailheader"
jdbc-type="VARCHAR"/>
  <reference-descriptor name="user" class-ref="nl.salesmakers.model.User">
    <foreignkey field-ref="userId"/>
  </reference-descriptor>
  <reference-descriptor name="company"
class-ref="nl.salesmakers.model.Company">
    <foreignkey field-ref="companyId"/>
  </reference-descriptor>
  <field-descriptor name="online" column="online" jdbc-type="INTEGER"/>
</class-descriptor>

Dennis

----- Original Message ----- 
From: "Jakob Braeuchi" <jb...@gmx.ch>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Wednesday, June 09, 2004 9:39 PM
Subject: Re: joining


> hi dennis,
>
> how does the classdescriptor for Contact look ?
>
> jakob
>
> dennis bekkering wrote:
>
> > Hello,
> >
> > I have class Mail with some collections that return contacts.
> >
> > public class Mail
> > {
> >  private Collection attachementList = new ArrayList();
> >  private Collection bccList = new ArrayList();
> >  private Collection ccList = new ArrayList();
> >  private Collection toList = new ArrayList();
> > ........
> >  }
> >
> > descriptor :
> >
> >   <collection-descriptor name="toList"
> > element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
> > auto-update="true" auto-delete="false"
indirection-table="MailTo2Contact">
> >     <fk-pointing-to-this-class column="mailid"/>
> >     <fk-pointing-to-element-class column="contactId"/>
> >   </collection-descriptor>
> >   <collection-descriptor name="ccList"
> > element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
> > auto-update="true" auto-delete="false"
indirection-table="MailCc2Contact">
> >     <fk-pointing-to-this-class column="mailid"/>
> >     <fk-pointing-to-element-class column="contactId"/>
> >   </collection-descriptor>
> >   <collection-descriptor name="bccList"
> > element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
> > auto-update="true" auto-delete="false"
indirection-table="MailBcc2Contact">
> >     <fk-pointing-to-this-class column="mailid"/>
> >     <fk-pointing-to-element-class column="contactId"/>
> >   </collection-descriptor>
> >
> >
> > My sql query for getting all mail messages send to a certain contact :
> >
> > " SELECT distinct m.* " +
> >  " FROM " +
> >       " Mail m , " +
> >       " Contact c , " +
> >       " MailTo2Contact mtc ," +
> >       " MailCc2Contact mcc ," +
> >       " MailBcc2Contact mbc " +
> >  " WHERE " +
> >        " (( m.id = mtc.mailid" +
> >            " AND" +
> >        " c.id = mtc.contactid )" +
> >   " OR " +
> >        " (m.id = mcc.mailid" +
> >            " AND" +
> >        " c.id = mcc.contactid )" +
> >   " OR " +
> >        " (m.id = mbc.mailid" +
> >            " AND" +
> >        " mbc.contactid = c.id   ))" +
> >   " AND " +
> >       " c.id = " + contact.getId() +
> >   " AND " +
> >       " m.flag = 'sent'" +
> >   " order by m.date desc"    +
> >   "";
> >
> > I offcourse would like to use the pb API but dont know how. Any hints? I
> > cannot use select in , since mysql 4.0 does not support them and 4.1 is
not
> > in production.
> >
> > regards,
> > Dennis
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: joining

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi dennis,

how does the classdescriptor for Contact look ?

jakob

dennis bekkering wrote:

> Hello,
> 
> I have class Mail with some collections that return contacts.
> 
> public class Mail
> {
>  private Collection attachementList = new ArrayList();
>  private Collection bccList = new ArrayList();
>  private Collection ccList = new ArrayList();
>  private Collection toList = new ArrayList();
> ........
>  }
> 
> descriptor :
> 
>   <collection-descriptor name="toList"
> element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
> auto-update="true" auto-delete="false" indirection-table="MailTo2Contact">
>     <fk-pointing-to-this-class column="mailid"/>
>     <fk-pointing-to-element-class column="contactId"/>
>   </collection-descriptor>
>   <collection-descriptor name="ccList"
> element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
> auto-update="true" auto-delete="false" indirection-table="MailCc2Contact">
>     <fk-pointing-to-this-class column="mailid"/>
>     <fk-pointing-to-element-class column="contactId"/>
>   </collection-descriptor>
>   <collection-descriptor name="bccList"
> element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
> auto-update="true" auto-delete="false" indirection-table="MailBcc2Contact">
>     <fk-pointing-to-this-class column="mailid"/>
>     <fk-pointing-to-element-class column="contactId"/>
>   </collection-descriptor>
> 
> 
> My sql query for getting all mail messages send to a certain contact :
> 
> " SELECT distinct m.* " +
>  " FROM " +
>       " Mail m , " +
>       " Contact c , " +
>       " MailTo2Contact mtc ," +
>       " MailCc2Contact mcc ," +
>       " MailBcc2Contact mbc " +
>  " WHERE " +
>        " (( m.id = mtc.mailid" +
>            " AND" +
>        " c.id = mtc.contactid )" +
>   " OR " +
>        " (m.id = mcc.mailid" +
>            " AND" +
>        " c.id = mcc.contactid )" +
>   " OR " +
>        " (m.id = mbc.mailid" +
>            " AND" +
>        " mbc.contactid = c.id   ))" +
>   " AND " +
>       " c.id = " + contact.getId() +
>   " AND " +
>       " m.flag = 'sent'" +
>   " order by m.date desc"    +
>   "";
> 
> I offcourse would like to use the pb API but dont know how. Any hints? I
> cannot use select in , since mysql 4.0 does not support them and 4.1 is not
> in production.
> 
> regards,
> Dennis
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


joining

Posted by dennis bekkering <dj...@hotmail.com>.
Hello,

I have class Mail with some collections that return contacts.

public class Mail
{
 private Collection attachementList = new ArrayList();
 private Collection bccList = new ArrayList();
 private Collection ccList = new ArrayList();
 private Collection toList = new ArrayList();
........
 }

descriptor :

  <collection-descriptor name="toList"
element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
auto-update="true" auto-delete="false" indirection-table="MailTo2Contact">
    <fk-pointing-to-this-class column="mailid"/>
    <fk-pointing-to-element-class column="contactId"/>
  </collection-descriptor>
  <collection-descriptor name="ccList"
element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
auto-update="true" auto-delete="false" indirection-table="MailCc2Contact">
    <fk-pointing-to-this-class column="mailid"/>
    <fk-pointing-to-element-class column="contactId"/>
  </collection-descriptor>
  <collection-descriptor name="bccList"
element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
auto-update="true" auto-delete="false" indirection-table="MailBcc2Contact">
    <fk-pointing-to-this-class column="mailid"/>
    <fk-pointing-to-element-class column="contactId"/>
  </collection-descriptor>


My sql query for getting all mail messages send to a certain contact :

" SELECT distinct m.* " +
 " FROM " +
      " Mail m , " +
      " Contact c , " +
      " MailTo2Contact mtc ," +
      " MailCc2Contact mcc ," +
      " MailBcc2Contact mbc " +
 " WHERE " +
       " (( m.id = mtc.mailid" +
           " AND" +
       " c.id = mtc.contactid )" +
  " OR " +
       " (m.id = mcc.mailid" +
           " AND" +
       " c.id = mcc.contactid )" +
  " OR " +
       " (m.id = mbc.mailid" +
           " AND" +
       " mbc.contactid = c.id   ))" +
  " AND " +
      " c.id = " + contact.getId() +
  " AND " +
      " m.flag = 'sent'" +
  " order by m.date desc"    +
  "";

I offcourse would like to use the pb API but dont know how. Any hints? I
cannot use select in , since mysql 4.0 does not support them and 4.1 is not
in production.

regards,
Dennis

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: AW: Can not init Identity for given object

Posted by Ilkka Priha <im...@surfeu.fi>.
Hi,

I just had the same exception with mysql for a totally different reason. When I 
updated from 4.1.1-alpha to 4.1.2-alpha in Windows without changing the db, OJB 
couldn't read the ojb_hl_seq table causing inserts violating the primary key 
constraint and thus failing to generate pks. The reason was that the primary key 
index of the ojb_hl_seq table had to be rebuild before selects started to work.

This has nothing to do with OJB, queries from other clients failed as well and 
to some other indexed tables, too (but not all, which took me some time to 
figure out what was wrong).

Just to inform you and others who might meet the same problem.

-- Ilkka


Christian Eugster wrote:
> Hi Armin
> 
> I think I got it. There are three threads that tryed to insert the same
> data. I hat put the grabSize to one and that seemed to make troubles. I
> think, that the number using in grabSize has to be set to a number
> corresponding to the number of threads?
> 
> Thank you for your answer!
> 
> Christian
> 
> 
>>-----Ursprungliche Nachricht-----
>>Von: Armin Waibel [mailto:arminw@apache.org]
>>Gesendet: Dienstag, 8. Juni 2004 12:14
>>An: OJB Users List
>>Betreff: Re: Can not init Identity for given object
>>
>>
>>Hi Christian,
>>
>>seems expected behaviour. SequenceManagerHighLowImpl use optimistic
>>locking to guarantee unique HighLowSequence objects. In current
>>implementation SequenceManagerHighLowImpl try five times to get next
>>sequence object. If all calls fails the last OptimisticLockingException
>>was thrown:
>>
>> > Caused by:
>>org.apache.ojb.broker.util.sequence.SequenceManagerException:
>> > Can't build new sequence
>>...
>> > Caused by: org.apache.ojb.broker.OptimisticLockException:
>>Object has been
>> > modified by someone else
>>
>>How many threads try to insert the same data?
>>
>>regards,
>>Armin
>>
>>Christian Eugster wrote:
>>
>>>Hi!
>>>
>>>I meet a problem using ojb 1.0rc5 and mysql (innodb): when i
>>
>>try to insert
>>
>>>an object with some children  in a concurrent environment a
>>>ClassNotPersistenceCapableException is thrown if some other clients are
>>>doing the same (See the stacktrace below).
>>>
>>>What am I doing wrong? Has anybody experienced the same and
>>
>>solved it (and:
>>
>>>how)?
>>>
>>>Thank you for answering?
>>>
>>>Stacktrace:
>>>INFO: Beleg wird gespeichert...
>>>08.06.2004 08:14:16 ch.eugster.pos.db.Table describeError
>>>SCHWERWIEGEND: Can not init Identity for given object
>>>ch.eugster.pos.db.Position@8ca8ac
>>>
>>
>>org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException
>>: Can not
>>
>>>init Identity for given
>>>object ch.eugster.pos.db.Position@8ca8ac
>>>        at org.apache.ojb.broker.Identity.init(Unknown Source)
>>>        at org.apache.ojb.broker.Identity.<init>(Unknown Source)
>>>        at
>>
>>org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
>>
>>>Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollectionOb
>>ject(Unkno
>>
>>>wn Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollections(Unknown
>>
>>>Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
>>
>>>        at
>>
>>org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
>>
>>>Source)
>>>        at
>>
>>org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
>>
>>>Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unkno
>>wn Source)
>>
>>>        at
>>>
>>
>>org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unkno
>>wn Source)
>>
>>>        at ch.eugster.pos.db.Table.store(Table.java:119)
>>>        at ch.eugster.pos.db.Table.store(Table.java:215)
>>>        at
>>>
>>
>>ch.eugster.pos.client.model.ReceiptModel.storeReceipt(ReceiptModel
>>.java:313)
>>
>>>        at
>>>
>>
>>ch.eugster.pos.client.model.ReceiptModel.posEventPerformed(Receipt
>>Model.java
>>
>>>:210)
>>>        at
>>>ch.eugster.pos.client.event.Action.actionPerformed(Action.java:114)
>>>        at
>>>
>>
>>ch.eugster.pos.client.event.StoreReceiptAction.actionPerformed(Sto
>>reReceiptA
>>
>>>ction.java:85
>>>)
>>>        at
>>>
>>
>>ch.eugster.pos.client.event.ExpressStoreReceiptAction.actionPerfor
>>med(Expres
>>
>>>sStoreReceipt
>>>Action.java:99)
>>>        at
>>
>>javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>>
>>>        at
>>>javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
>>>Source)
>>>        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
>>>Source)
>>>        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>>>        at
>>
>>javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
>>
>>>Source)
>>>        at java.awt.Component.processMouseEvent(Unknown Source)
>>>        at java.awt.Component.processEvent(Unknown Source)
>>>        at java.awt.Container.processEvent(Unknown Source)
>>>        at java.awt.Component.dispatchEventImpl(Unknown Source)
>>>        at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>        at java.awt.Component.dispatchEvent(Unknown Source)
>>>        at
>>
>>java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
>>
>>>        at
>>
>>java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
>>
>>>        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>>>        at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>        at java.awt.Window.dispatchEventImpl(Unknown Source)
>>>        at java.awt.Component.dispatchEvent(Unknown Source)
>>>        at java.awt.EventQueue.dispatchEvent(Unknown Source)
>>>        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
>>>Source)
>>>        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
>>>Source)
>>>        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>>        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>>        at java.awt.EventDispatchThread.run(Unknown Source)
>>>Caused by: org.apache.ojb.broker.PersistenceBrokerException:
>>
>>Could not get
>>
>>>key value
>>>        at
>>>org.apache.ojb.broker.util.BrokerHelper.getAutoIncrementValue(Unknown
>>>Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.BrokerHelper.getValuesForObject(Unknown Source)
>>
>>>        at org.apache.ojb.broker.util.BrokerHelper.getKeyValues(Unknown
>>>Source)
>>>        ... 40 more
>>>Caused by: org.apache.ojb.broker.util.sequence.SequenceManagerException:
>>>Can't build new sequence
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.get
>>Sequence(U
>>
>>>nknown Source
>>>)
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.get
>>UniqueLong
>>
>>>(Unknown Sour
>>>ce)
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.sequence.AbstractSequenceManager.getUni
>>queValue(U
>>
>>>nknown Source
>>>)
>>>        ... 43 more
>>>Caused by: org.apache.ojb.broker.OptimisticLockException:
>>
>>Object has been
>>
>>>modified by someone else
>>>        at
>>>org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
>>>Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
>>
>>>        at
>>
>>org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
>>
>>>Source)
>>>        at
>>
>>org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
>>
>>>Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unkno
>>wn Source)
>>
>>>        at
>>>
>>
>>org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unkno
>>wn Source)
>>
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
>>kupStoreSe
>>
>>>quence(Unknow
>>>n Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
>>kupStoreSe
>>
>>>quence(Unknow
>>>n Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
>>kupStoreSe
>>
>>>quence(Unknow
>>>n Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
>>kupStoreSe
>>
>>>quence(Unknow
>>>n Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
>>kupStoreSe
>>
>>>quence(Unknow
>>>n Source)
>>>        at
>>>
>>
>>org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
>>kupStoreSe
>>
>>>quence(Unknow
>>>n Source)
>>>        ... 46 more
>>>
>>>
>>>the used classes are (class-descriptors)
>>>Receipt:
>>><class-descriptor class="ch.eugster.pos.db.Receipt" table="pos_receipt"
>>>isolation-level="read-uncommitted" accept-locks="true" refresh="false">
>>>    <field-descriptor name="id" column="id" jdbc-type="BIGINT"
>>>primarykey="true" indexed="true" access="readwrite" autoincrement="true"
>>>nullable="true" locking="false" update-lock="true"
>>
>>default-fetch="false" />
>>
>>>    <field-descriptor name="timestamp" column="timestamp"
>>>jdbc-type="TIMESTAMP" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="number" column="number" indexed="true"
>>>jdbc-type="VARCHAR" length="25" primarykey="false" nullable="true"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="transactionId" column="transaction_id"
>>>jdbc-type="BIGINT" primarykey="false" indexed="true" access="readwrite"
>>>autoincrement="false" nullable="false" locking="false"
>>
>>update-lock="true"
>>
>>>default-fetch="false" />
>>>    <field-descriptor name="bookingId" column="booking_id"
>>>jdbc-type="BIGINT" primarykey="false" indexed="true" access="readwrite"
>>>autoincrement="false" nullable="false" locking="false"
>>
>>update-lock="true"
>>
>>>default-fetch="false" />
>>>    <field-descriptor name="salespointId" column="salespoint_id"
>>>jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="userId" column="user_id" jdbc-type="BIGINT"
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="foreignCurrencyId"
>>
>>column="foreign_currency_id"
>>
>>>jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="status" column="status" jdbc-type="INTEGER"
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="settlement" column="settlement"
>>>jdbc-type="BIGINT" primarykey="false" indexed="true" nullable="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="amount" column="amount" jdbc-type="DOUBLE"
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="payment" column="payment" jdbc-type="DOUBLE"
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="paymentFC" column="payment_fc"
>>>jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>
>>>    <reference-descriptor name="salespoint"
>>>class-ref="ch.eugster.pos.db.Salespoint" proxy="false" refresh="false"
>>>auto-retrieve="true" auto-update="false" auto-delete="false"
>>>otm-dependent="false">
>>>   	 	<foreignkey field-ref="salespointId" />
>>>    </reference-descriptor>
>>>
>>>    <reference-descriptor name="user" class-ref="ch.eugster.pos.db.User"
>>>proxy="false" refresh="false" auto-retrieve="true" auto-update="false"
>>>auto-delete="false" otm-dependent="false">
>>>   	 	<foreignkey field-ref="userId" />
>>>    </reference-descriptor>
>>>
>>>    <reference-descriptor name="foreignCurrency"
>>>class-ref="ch.eugster.pos.db.ForeignCurrency" proxy="false"
>>
>>refresh="false"
>>
>>>auto-retrieve="true" auto-update="false" auto-delete="false"
>>>otm-dependent="false">
>>>   	 	<foreignkey field-ref="foreignCurrencyId" />
>>>    </reference-descriptor>
>>>
>>>    <collection-descriptor name="positions"
>>>element-class-ref="ch.eugster.pos.db.Position" auto-retrieve="true"
>>>auto-update="true" auto-delete="true" sort="ASC" proxy="false"
>>>refresh="false" otm-dependent="false">
>>>	   	<orderby name="id" sort="ASC" />
>>>    	<inverse-foreignkey field-ref="receiptId" />
>>>    </collection-descriptor>
>>>
>>>    <collection-descriptor name="payments"
>>>element-class-ref="ch.eugster.pos.db.Payment" auto-retrieve="true"
>>>auto-update="true" auto-delete="true" sort="ASC" proxy="false"
>>>refresh="false" otm-dependent="false">
>>>	   	<orderby name="id" sort="ASC" />
>>>	   	<inverse-foreignkey field-ref="receiptId" />
>>>    </collection-descriptor>
>>></class-descriptor>
>>>
>>>Position:
>>><class-descriptor class="ch.eugster.pos.db.Position"
>>
>>table="pos_position"
>>
>>>isolation-level="read-uncommitted" accept-locks="true" refresh="false">
>>>    <field-descriptor name="id" column="id" jdbc-type="BIGINT"
>>>primarykey="true" indexed="true" access="readwrite" autoincrement="true"
>>>nullable="true" locking="false" update-lock="true"
>>
>>default-fetch="false" />
>>
>>>    <field-descriptor name="receiptId" column="receipt_id"
>>>jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="productId" column="product_id"
>>>jdbc-type="VARCHAR" length="50" primarykey="false" nullable="true"
>>>indexed="false" autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="productGroupId" column="product_group_id"
>>>jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="currentTaxId" column="current_tax_id"
>>>jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="quantity" column="quantity"
>>
>>jdbc-type="INTEGER"
>>
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="price" column="price" jdbc-type="DOUBLE"
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="discount" column="discount"
>>
>>jdbc-type="DOUBLE"
>>
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="expense" column="expense" jdbc-type="BIT"
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="galileoBook" column="galileo_book"
>>>jdbc-type="BIT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="galileoBooked" column="galileo_booked"
>>>jdbc-type="BIT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="optCode" column="opt_code" jdbc-type="CHAR"
>>>length="1" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="author" column="author" jdbc-type="VARCHAR"
>>>length="100" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="title" column="title" jdbc-type="VARCHAR"
>>>length="100" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="publisher" column="publisher"
>>>jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true"
>>>indexed="false" autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="isbn" column="isbn" jdbc-type="VARCHAR"
>>>length="13" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="bznr" column="bznr" jdbc-type="VARCHAR"
>>>length="10" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="productNumber" column="product_number"
>>>jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true"
>>>indexed="false" autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="ordered" column="ordered" jdbc-type="BIT"
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="orderId" column="order_id"
>>
>>jdbc-type="VARCHAR"
>>
>>>length="100" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>
>>>    <reference-descriptor name="receipt"
>>>class-ref="ch.eugster.pos.db.Receipt" proxy="false" refresh="false"
>>>auto-retrieve="true" auto-update="false" auto-delete="false"
>>>otm-dependent="false">
>>>   	 	<foreignkey field-ref="receiptId" />
>>>    </reference-descriptor>
>>>
>>>    <reference-descriptor name="productGroup"
>>>class-ref="ch.eugster.pos.db.ProductGroup" proxy="false" refresh="false"
>>>auto-retrieve="true" auto-update="false" auto-delete="false"
>>>otm-dependent="false">
>>>   	 	<foreignkey field-ref="productGroupId" />
>>>    </reference-descriptor>
>>>
>>>    <reference-descriptor name="currentTax"
>>>class-ref="ch.eugster.pos.db.CurrentTax" proxy="false" refresh="false"
>>>auto-retrieve="true" auto-update="false" auto-delete="false"
>>>otm-dependent="false">
>>>   	 	<foreignkey field-ref="currentTaxId" />
>>>    </reference-descriptor>
>>>
>>></class-descriptor>
>>>
>>>Payment:
>>><class-descriptor class="ch.eugster.pos.db.Payment" table="pos_payment"
>>>isolation-level="read-uncommitted" accept-locks="true" refresh="false">
>>>    <field-descriptor name="id" column="id" jdbc-type="BIGINT"
>>>primarykey="true" indexed="true" access="readwrite" autoincrement="true"
>>>nullable="true" locking="false" update-lock="true"
>>
>>default-fetch="false" />
>>
>>>    <field-descriptor name="receiptId" column="receipt_id"
>>>jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="paymentTypeId" column="payment_type_id"
>>>jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="foreignCurrencyId"
>>
>>column="foreign_currency_id"
>>
>>>jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="quotation" column="quotation"
>>
>>jdbc-type="DOUBLE"
>>
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="amount" column="amount" jdbc-type="DOUBLE"
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="amountFC" column="amount_fc"
>>
>>jdbc-type="DOUBLE"
>>
>>>primarykey="false" nullable="true" indexed="false" autoincrement="false"
>>>locking="false" update-lock="true" default-fetch="false"
>>
>>access="readwrite"
>>
>>>/>
>>>    <field-descriptor name="roundFactor" column="round_factor"
>>>jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>    <field-descriptor name="roundFactorFC" column="round_factor_fc"
>>>jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
>>>autoincrement="false" locking="false" update-lock="true"
>>>default-fetch="false" access="readwrite" />
>>>
>>>    <reference-descriptor name="receipt"
>>>class-ref="ch.eugster.pos.db.Receipt" proxy="false" refresh="false"
>>>auto-retrieve="true" auto-update="false" auto-delete="false"
>>>otm-dependent="false">
>>>   	 	<foreignkey field-ref="receiptId" />
>>>    </reference-descriptor>
>>>
>>>    <reference-descriptor name="paymentType"
>>>class-ref="ch.eugster.pos.db.PaymentType" proxy="false" refresh="false"
>>>auto-retrieve="true" auto-update="false" auto-delete="false"
>>>otm-dependent="false">
>>>   	 	<foreignkey field-ref="paymentTypeId" />
>>>    </reference-descriptor>
>>>
>>>    <reference-descriptor name="foreignCurrency"
>>>class-ref="ch.eugster.pos.db.ForeignCurrency" proxy="false"
>>
>>refresh="false"
>>
>>>auto-retrieve="true" auto-update="false" auto-delete="false"
>>>otm-dependent="false">
>>>   	 	<foreignkey field-ref="foreignCurrencyId" />
>>>    </reference-descriptor>
>>>
>>></class-descriptor>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> .
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


AW: Can not init Identity for given object

Posted by Christian Eugster <ch...@bluewin.ch>.
Hi Armin

I think I got it. There are three threads that tryed to insert the same
data. I hat put the grabSize to one and that seemed to make troubles. I
think, that the number using in grabSize has to be set to a number
corresponding to the number of threads?

Thank you for your answer!

Christian

> -----Ursprungliche Nachricht-----
> Von: Armin Waibel [mailto:arminw@apache.org]
> Gesendet: Dienstag, 8. Juni 2004 12:14
> An: OJB Users List
> Betreff: Re: Can not init Identity for given object
>
>
> Hi Christian,
>
> seems expected behaviour. SequenceManagerHighLowImpl use optimistic
> locking to guarantee unique HighLowSequence objects. In current
> implementation SequenceManagerHighLowImpl try five times to get next
> sequence object. If all calls fails the last OptimisticLockingException
> was thrown:
>
>  > Caused by:
> org.apache.ojb.broker.util.sequence.SequenceManagerException:
>  > Can't build new sequence
> ...
>  > Caused by: org.apache.ojb.broker.OptimisticLockException:
> Object has been
>  > modified by someone else
>
> How many threads try to insert the same data?
>
> regards,
> Armin
>
> Christian Eugster wrote:
> > Hi!
> >
> > I meet a problem using ojb 1.0rc5 and mysql (innodb): when i
> try to insert
> > an object with some children  in a concurrent environment a
> > ClassNotPersistenceCapableException is thrown if some other clients are
> > doing the same (See the stacktrace below).
> >
> > What am I doing wrong? Has anybody experienced the same and
> solved it (and:
> > how)?
> >
> > Thank you for answering?
> >
> > Stacktrace:
> > INFO: Beleg wird gespeichert...
> > 08.06.2004 08:14:16 ch.eugster.pos.db.Table describeError
> > SCHWERWIEGEND: Can not init Identity for given object
> > ch.eugster.pos.db.Position@8ca8ac
> >
> org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException
> : Can not
> > init Identity for given
> > object ch.eugster.pos.db.Position@8ca8ac
> >         at org.apache.ojb.broker.Identity.init(Unknown Source)
> >         at org.apache.ojb.broker.Identity.<init>(Unknown Source)
> >         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >         at
> >
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollectionOb
> ject(Unkno
> > wn Source)
> >         at
> >
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollections(Unknown
> > Source)
> >         at
> >
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
> >         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >         at
> >
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unkno
> wn Source)
> >         at
> >
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unkno
> wn Source)
> >         at ch.eugster.pos.db.Table.store(Table.java:119)
> >         at ch.eugster.pos.db.Table.store(Table.java:215)
> >         at
> >
> ch.eugster.pos.client.model.ReceiptModel.storeReceipt(ReceiptModel
> .java:313)
> >         at
> >
> ch.eugster.pos.client.model.ReceiptModel.posEventPerformed(Receipt
> Model.java
> > :210)
> >         at
> > ch.eugster.pos.client.event.Action.actionPerformed(Action.java:114)
> >         at
> >
> ch.eugster.pos.client.event.StoreReceiptAction.actionPerformed(Sto
> reReceiptA
> > ction.java:85
> > )
> >         at
> >
> ch.eugster.pos.client.event.ExpressStoreReceiptAction.actionPerfor
> med(Expres
> > sStoreReceipt
> > Action.java:99)
> >         at
> javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> >         at
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
> > Source)
> >         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
> > Source)
> >         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
> >         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
> > Source)
> >         at java.awt.Component.processMouseEvent(Unknown Source)
> >         at java.awt.Component.processEvent(Unknown Source)
> >         at java.awt.Container.processEvent(Unknown Source)
> >         at java.awt.Component.dispatchEventImpl(Unknown Source)
> >         at java.awt.Container.dispatchEventImpl(Unknown Source)
> >         at java.awt.Component.dispatchEvent(Unknown Source)
> >         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
> >         at
> java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
> >         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
> >         at java.awt.Container.dispatchEventImpl(Unknown Source)
> >         at java.awt.Window.dispatchEventImpl(Unknown Source)
> >         at java.awt.Component.dispatchEvent(Unknown Source)
> >         at java.awt.EventQueue.dispatchEvent(Unknown Source)
> >         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
> > Source)
> >         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
> > Source)
> >         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> >         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> >         at java.awt.EventDispatchThread.run(Unknown Source)
> > Caused by: org.apache.ojb.broker.PersistenceBrokerException:
> Could not get
> > key value
> >         at
> > org.apache.ojb.broker.util.BrokerHelper.getAutoIncrementValue(Unknown
> > Source)
> >         at
> >
> org.apache.ojb.broker.util.BrokerHelper.getValuesForObject(Unknown Source)
> >         at org.apache.ojb.broker.util.BrokerHelper.getKeyValues(Unknown
> > Source)
> >         ... 40 more
> > Caused by: org.apache.ojb.broker.util.sequence.SequenceManagerException:
> > Can't build new sequence
> >         at
> >
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.get
> Sequence(U
> > nknown Source
> > )
> >         at
> >
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.get
> UniqueLong
> > (Unknown Sour
> > ce)
> >         at
> >
> org.apache.ojb.broker.util.sequence.AbstractSequenceManager.getUni
> queValue(U
> > nknown Source
> > )
> >         ... 43 more
> > Caused by: org.apache.ojb.broker.OptimisticLockException:
> Object has been
> > modified by someone else
> >         at
> > org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
> > Source)
> >         at
> >
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
> >         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >         at
> >
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unkno
> wn Source)
> >         at
> >
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unkno
> wn Source)
> >         at
> >
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
> kupStoreSe
> > quence(Unknow
> > n Source)
> >         at
> >
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
> kupStoreSe
> > quence(Unknow
> > n Source)
> >         at
> >
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
> kupStoreSe
> > quence(Unknow
> > n Source)
> >         at
> >
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
> kupStoreSe
> > quence(Unknow
> > n Source)
> >         at
> >
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
> kupStoreSe
> > quence(Unknow
> > n Source)
> >         at
> >
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.loo
> kupStoreSe
> > quence(Unknow
> > n Source)
> >         ... 46 more
> >
> >
> > the used classes are (class-descriptors)
> > Receipt:
> > <class-descriptor class="ch.eugster.pos.db.Receipt" table="pos_receipt"
> > isolation-level="read-uncommitted" accept-locks="true" refresh="false">
> >     <field-descriptor name="id" column="id" jdbc-type="BIGINT"
> > primarykey="true" indexed="true" access="readwrite" autoincrement="true"
> > nullable="true" locking="false" update-lock="true"
> default-fetch="false" />
> >     <field-descriptor name="timestamp" column="timestamp"
> > jdbc-type="TIMESTAMP" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="number" column="number" indexed="true"
> > jdbc-type="VARCHAR" length="25" primarykey="false" nullable="true"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="transactionId" column="transaction_id"
> > jdbc-type="BIGINT" primarykey="false" indexed="true" access="readwrite"
> > autoincrement="false" nullable="false" locking="false"
> update-lock="true"
> > default-fetch="false" />
> >     <field-descriptor name="bookingId" column="booking_id"
> > jdbc-type="BIGINT" primarykey="false" indexed="true" access="readwrite"
> > autoincrement="false" nullable="false" locking="false"
> update-lock="true"
> > default-fetch="false" />
> >     <field-descriptor name="salespointId" column="salespoint_id"
> > jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="userId" column="user_id" jdbc-type="BIGINT"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="foreignCurrencyId"
> column="foreign_currency_id"
> > jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="status" column="status" jdbc-type="INTEGER"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="settlement" column="settlement"
> > jdbc-type="BIGINT" primarykey="false" indexed="true" nullable="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="amount" column="amount" jdbc-type="DOUBLE"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="payment" column="payment" jdbc-type="DOUBLE"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="paymentFC" column="payment_fc"
> > jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >
> >     <reference-descriptor name="salespoint"
> > class-ref="ch.eugster.pos.db.Salespoint" proxy="false" refresh="false"
> > auto-retrieve="true" auto-update="false" auto-delete="false"
> > otm-dependent="false">
> >    	 	<foreignkey field-ref="salespointId" />
> >     </reference-descriptor>
> >
> >     <reference-descriptor name="user" class-ref="ch.eugster.pos.db.User"
> > proxy="false" refresh="false" auto-retrieve="true" auto-update="false"
> > auto-delete="false" otm-dependent="false">
> >    	 	<foreignkey field-ref="userId" />
> >     </reference-descriptor>
> >
> >     <reference-descriptor name="foreignCurrency"
> > class-ref="ch.eugster.pos.db.ForeignCurrency" proxy="false"
> refresh="false"
> > auto-retrieve="true" auto-update="false" auto-delete="false"
> > otm-dependent="false">
> >    	 	<foreignkey field-ref="foreignCurrencyId" />
> >     </reference-descriptor>
> >
> >     <collection-descriptor name="positions"
> > element-class-ref="ch.eugster.pos.db.Position" auto-retrieve="true"
> > auto-update="true" auto-delete="true" sort="ASC" proxy="false"
> > refresh="false" otm-dependent="false">
> > 	   	<orderby name="id" sort="ASC" />
> >     	<inverse-foreignkey field-ref="receiptId" />
> >     </collection-descriptor>
> >
> >     <collection-descriptor name="payments"
> > element-class-ref="ch.eugster.pos.db.Payment" auto-retrieve="true"
> > auto-update="true" auto-delete="true" sort="ASC" proxy="false"
> > refresh="false" otm-dependent="false">
> > 	   	<orderby name="id" sort="ASC" />
> > 	   	<inverse-foreignkey field-ref="receiptId" />
> >     </collection-descriptor>
> > </class-descriptor>
> >
> > Position:
> > <class-descriptor class="ch.eugster.pos.db.Position"
> table="pos_position"
> > isolation-level="read-uncommitted" accept-locks="true" refresh="false">
> >     <field-descriptor name="id" column="id" jdbc-type="BIGINT"
> > primarykey="true" indexed="true" access="readwrite" autoincrement="true"
> > nullable="true" locking="false" update-lock="true"
> default-fetch="false" />
> >     <field-descriptor name="receiptId" column="receipt_id"
> > jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="productId" column="product_id"
> > jdbc-type="VARCHAR" length="50" primarykey="false" nullable="true"
> > indexed="false" autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="productGroupId" column="product_group_id"
> > jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="currentTaxId" column="current_tax_id"
> > jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="quantity" column="quantity"
> jdbc-type="INTEGER"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="price" column="price" jdbc-type="DOUBLE"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="discount" column="discount"
> jdbc-type="DOUBLE"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="expense" column="expense" jdbc-type="BIT"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="galileoBook" column="galileo_book"
> > jdbc-type="BIT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="galileoBooked" column="galileo_booked"
> > jdbc-type="BIT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="optCode" column="opt_code" jdbc-type="CHAR"
> > length="1" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="author" column="author" jdbc-type="VARCHAR"
> > length="100" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="title" column="title" jdbc-type="VARCHAR"
> > length="100" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="publisher" column="publisher"
> > jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true"
> > indexed="false" autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="isbn" column="isbn" jdbc-type="VARCHAR"
> > length="13" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="bznr" column="bznr" jdbc-type="VARCHAR"
> > length="10" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="productNumber" column="product_number"
> > jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true"
> > indexed="false" autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="ordered" column="ordered" jdbc-type="BIT"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="orderId" column="order_id"
> jdbc-type="VARCHAR"
> > length="100" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >
> >     <reference-descriptor name="receipt"
> > class-ref="ch.eugster.pos.db.Receipt" proxy="false" refresh="false"
> > auto-retrieve="true" auto-update="false" auto-delete="false"
> > otm-dependent="false">
> >    	 	<foreignkey field-ref="receiptId" />
> >     </reference-descriptor>
> >
> >     <reference-descriptor name="productGroup"
> > class-ref="ch.eugster.pos.db.ProductGroup" proxy="false" refresh="false"
> > auto-retrieve="true" auto-update="false" auto-delete="false"
> > otm-dependent="false">
> >    	 	<foreignkey field-ref="productGroupId" />
> >     </reference-descriptor>
> >
> >     <reference-descriptor name="currentTax"
> > class-ref="ch.eugster.pos.db.CurrentTax" proxy="false" refresh="false"
> > auto-retrieve="true" auto-update="false" auto-delete="false"
> > otm-dependent="false">
> >    	 	<foreignkey field-ref="currentTaxId" />
> >     </reference-descriptor>
> >
> > </class-descriptor>
> >
> > Payment:
> > <class-descriptor class="ch.eugster.pos.db.Payment" table="pos_payment"
> > isolation-level="read-uncommitted" accept-locks="true" refresh="false">
> >     <field-descriptor name="id" column="id" jdbc-type="BIGINT"
> > primarykey="true" indexed="true" access="readwrite" autoincrement="true"
> > nullable="true" locking="false" update-lock="true"
> default-fetch="false" />
> >     <field-descriptor name="receiptId" column="receipt_id"
> > jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="paymentTypeId" column="payment_type_id"
> > jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="foreignCurrencyId"
> column="foreign_currency_id"
> > jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="quotation" column="quotation"
> jdbc-type="DOUBLE"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="amount" column="amount" jdbc-type="DOUBLE"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="amountFC" column="amount_fc"
> jdbc-type="DOUBLE"
> > primarykey="false" nullable="true" indexed="false" autoincrement="false"
> > locking="false" update-lock="true" default-fetch="false"
> access="readwrite"
> > />
> >     <field-descriptor name="roundFactor" column="round_factor"
> > jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >     <field-descriptor name="roundFactorFC" column="round_factor_fc"
> > jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
> > autoincrement="false" locking="false" update-lock="true"
> > default-fetch="false" access="readwrite" />
> >
> >     <reference-descriptor name="receipt"
> > class-ref="ch.eugster.pos.db.Receipt" proxy="false" refresh="false"
> > auto-retrieve="true" auto-update="false" auto-delete="false"
> > otm-dependent="false">
> >    	 	<foreignkey field-ref="receiptId" />
> >     </reference-descriptor>
> >
> >     <reference-descriptor name="paymentType"
> > class-ref="ch.eugster.pos.db.PaymentType" proxy="false" refresh="false"
> > auto-retrieve="true" auto-update="false" auto-delete="false"
> > otm-dependent="false">
> >    	 	<foreignkey field-ref="paymentTypeId" />
> >     </reference-descriptor>
> >
> >     <reference-descriptor name="foreignCurrency"
> > class-ref="ch.eugster.pos.db.ForeignCurrency" proxy="false"
> refresh="false"
> > auto-retrieve="true" auto-update="false" auto-delete="false"
> > otm-dependent="false">
> >    	 	<foreignkey field-ref="foreignCurrencyId" />
> >     </reference-descriptor>
> >
> > </class-descriptor>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Can not init Identity for given object

Posted by Armin Waibel <ar...@apache.org>.
Hi Christian,

seems expected behaviour. SequenceManagerHighLowImpl use optimistic 
locking to guarantee unique HighLowSequence objects. In current 
implementation SequenceManagerHighLowImpl try five times to get next 
sequence object. If all calls fails the last OptimisticLockingException 
was thrown:

 > Caused by: org.apache.ojb.broker.util.sequence.SequenceManagerException:
 > Can't build new sequence
...
 > Caused by: org.apache.ojb.broker.OptimisticLockException: Object has been
 > modified by someone else

How many threads try to insert the same data?

regards,
Armin

Christian Eugster wrote:
> Hi!
> 
> I meet a problem using ojb 1.0rc5 and mysql (innodb): when i try to insert
> an object with some children  in a concurrent environment a
> ClassNotPersistenceCapableException is thrown if some other clients are
> doing the same (See the stacktrace below).
> 
> What am I doing wrong? Has anybody experienced the same and solved it (and:
> how)?
> 
> Thank you for answering?
> 
> Stacktrace:
> INFO: Beleg wird gespeichert...
> 08.06.2004 08:14:16 ch.eugster.pos.db.Table describeError
> SCHWERWIEGEND: Can not init Identity for given object
> ch.eugster.pos.db.Position@8ca8ac
> org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: Can not
> init Identity for given
> object ch.eugster.pos.db.Position@8ca8ac
>         at org.apache.ojb.broker.Identity.init(Unknown Source)
>         at org.apache.ojb.broker.Identity.<init>(Unknown Source)
>         at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollectionObject(Unkno
> wn Source)
>         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollections(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
>         at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> Source)
>         at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
>         at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
>         at ch.eugster.pos.db.Table.store(Table.java:119)
>         at ch.eugster.pos.db.Table.store(Table.java:215)
>         at
> ch.eugster.pos.client.model.ReceiptModel.storeReceipt(ReceiptModel.java:313)
>         at
> ch.eugster.pos.client.model.ReceiptModel.posEventPerformed(ReceiptModel.java
> :210)
>         at
> ch.eugster.pos.client.event.Action.actionPerformed(Action.java:114)
>         at
> ch.eugster.pos.client.event.StoreReceiptAction.actionPerformed(StoreReceiptA
> ction.java:85
> )
>         at
> ch.eugster.pos.client.event.ExpressStoreReceiptAction.actionPerformed(Expres
> sStoreReceipt
> Action.java:99)
>         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
> Source)
>         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
> Source)
>         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
> Source)
>         at java.awt.Component.processMouseEvent(Unknown Source)
>         at java.awt.Component.processEvent(Unknown Source)
>         at java.awt.Container.processEvent(Unknown Source)
>         at java.awt.Component.dispatchEventImpl(Unknown Source)
>         at java.awt.Container.dispatchEventImpl(Unknown Source)
>         at java.awt.Component.dispatchEvent(Unknown Source)
>         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
>         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
>         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>         at java.awt.Container.dispatchEventImpl(Unknown Source)
>         at java.awt.Window.dispatchEventImpl(Unknown Source)
>         at java.awt.Component.dispatchEvent(Unknown Source)
>         at java.awt.EventQueue.dispatchEvent(Unknown Source)
>         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
> Source)
>         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
> Source)
>         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>         at java.awt.EventDispatchThread.run(Unknown Source)
> Caused by: org.apache.ojb.broker.PersistenceBrokerException: Could not get
> key value
>         at
> org.apache.ojb.broker.util.BrokerHelper.getAutoIncrementValue(Unknown
> Source)
>         at
> org.apache.ojb.broker.util.BrokerHelper.getValuesForObject(Unknown Source)
>         at org.apache.ojb.broker.util.BrokerHelper.getKeyValues(Unknown
> Source)
>         ... 40 more
> Caused by: org.apache.ojb.broker.util.sequence.SequenceManagerException:
> Can't build new sequence
>         at
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.getSequence(U
> nknown Source
> )
>         at
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueLong
> (Unknown Sour
> ce)
>         at
> org.apache.ojb.broker.util.sequence.AbstractSequenceManager.getUniqueValue(U
> nknown Source
> )
>         ... 43 more
> Caused by: org.apache.ojb.broker.OptimisticLockException: Object has been
> modified by someone else
>         at
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
>         at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> Source)
>         at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
>         at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
>         at
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
> quence(Unknow
> n Source)
>         at
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
> quence(Unknow
> n Source)
>         at
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
> quence(Unknow
> n Source)
>         at
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
> quence(Unknow
> n Source)
>         at
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
> quence(Unknow
> n Source)
>         at
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.lookupStoreSe
> quence(Unknow
> n Source)
>         ... 46 more
> 
> 
> the used classes are (class-descriptors)
> Receipt:
> <class-descriptor class="ch.eugster.pos.db.Receipt" table="pos_receipt"
> isolation-level="read-uncommitted" accept-locks="true" refresh="false">
>     <field-descriptor name="id" column="id" jdbc-type="BIGINT"
> primarykey="true" indexed="true" access="readwrite" autoincrement="true"
> nullable="true" locking="false" update-lock="true" default-fetch="false" />
>     <field-descriptor name="timestamp" column="timestamp"
> jdbc-type="TIMESTAMP" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="number" column="number" indexed="true"
> jdbc-type="VARCHAR" length="25" primarykey="false" nullable="true"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="transactionId" column="transaction_id"
> jdbc-type="BIGINT" primarykey="false" indexed="true" access="readwrite"
> autoincrement="false" nullable="false" locking="false" update-lock="true"
> default-fetch="false" />
>     <field-descriptor name="bookingId" column="booking_id"
> jdbc-type="BIGINT" primarykey="false" indexed="true" access="readwrite"
> autoincrement="false" nullable="false" locking="false" update-lock="true"
> default-fetch="false" />
>     <field-descriptor name="salespointId" column="salespoint_id"
> jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="userId" column="user_id" jdbc-type="BIGINT"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="foreignCurrencyId" column="foreign_currency_id"
> jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="status" column="status" jdbc-type="INTEGER"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="settlement" column="settlement"
> jdbc-type="BIGINT" primarykey="false" indexed="true" nullable="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="amount" column="amount" jdbc-type="DOUBLE"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="payment" column="payment" jdbc-type="DOUBLE"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="paymentFC" column="payment_fc"
> jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
> 
>     <reference-descriptor name="salespoint"
> class-ref="ch.eugster.pos.db.Salespoint" proxy="false" refresh="false"
> auto-retrieve="true" auto-update="false" auto-delete="false"
> otm-dependent="false">
>    	 	<foreignkey field-ref="salespointId" />
>     </reference-descriptor>
> 
>     <reference-descriptor name="user" class-ref="ch.eugster.pos.db.User"
> proxy="false" refresh="false" auto-retrieve="true" auto-update="false"
> auto-delete="false" otm-dependent="false">
>    	 	<foreignkey field-ref="userId" />
>     </reference-descriptor>
> 
>     <reference-descriptor name="foreignCurrency"
> class-ref="ch.eugster.pos.db.ForeignCurrency" proxy="false" refresh="false"
> auto-retrieve="true" auto-update="false" auto-delete="false"
> otm-dependent="false">
>    	 	<foreignkey field-ref="foreignCurrencyId" />
>     </reference-descriptor>
> 
>     <collection-descriptor name="positions"
> element-class-ref="ch.eugster.pos.db.Position" auto-retrieve="true"
> auto-update="true" auto-delete="true" sort="ASC" proxy="false"
> refresh="false" otm-dependent="false">
> 	   	<orderby name="id" sort="ASC" />
>     	<inverse-foreignkey field-ref="receiptId" />
>     </collection-descriptor>
> 
>     <collection-descriptor name="payments"
> element-class-ref="ch.eugster.pos.db.Payment" auto-retrieve="true"
> auto-update="true" auto-delete="true" sort="ASC" proxy="false"
> refresh="false" otm-dependent="false">
> 	   	<orderby name="id" sort="ASC" />
> 	   	<inverse-foreignkey field-ref="receiptId" />
>     </collection-descriptor>
> </class-descriptor>
> 
> Position:
> <class-descriptor class="ch.eugster.pos.db.Position" table="pos_position"
> isolation-level="read-uncommitted" accept-locks="true" refresh="false">
>     <field-descriptor name="id" column="id" jdbc-type="BIGINT"
> primarykey="true" indexed="true" access="readwrite" autoincrement="true"
> nullable="true" locking="false" update-lock="true" default-fetch="false" />
>     <field-descriptor name="receiptId" column="receipt_id"
> jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="productId" column="product_id"
> jdbc-type="VARCHAR" length="50" primarykey="false" nullable="true"
> indexed="false" autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="productGroupId" column="product_group_id"
> jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="currentTaxId" column="current_tax_id"
> jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="quantity" column="quantity" jdbc-type="INTEGER"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="price" column="price" jdbc-type="DOUBLE"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="discount" column="discount" jdbc-type="DOUBLE"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="expense" column="expense" jdbc-type="BIT"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="galileoBook" column="galileo_book"
> jdbc-type="BIT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="galileoBooked" column="galileo_booked"
> jdbc-type="BIT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="optCode" column="opt_code" jdbc-type="CHAR"
> length="1" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="author" column="author" jdbc-type="VARCHAR"
> length="100" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="title" column="title" jdbc-type="VARCHAR"
> length="100" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="publisher" column="publisher"
> jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true"
> indexed="false" autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="isbn" column="isbn" jdbc-type="VARCHAR"
> length="13" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="bznr" column="bznr" jdbc-type="VARCHAR"
> length="10" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="productNumber" column="product_number"
> jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true"
> indexed="false" autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="ordered" column="ordered" jdbc-type="BIT"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="orderId" column="order_id" jdbc-type="VARCHAR"
> length="100" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
> 
>     <reference-descriptor name="receipt"
> class-ref="ch.eugster.pos.db.Receipt" proxy="false" refresh="false"
> auto-retrieve="true" auto-update="false" auto-delete="false"
> otm-dependent="false">
>    	 	<foreignkey field-ref="receiptId" />
>     </reference-descriptor>
> 
>     <reference-descriptor name="productGroup"
> class-ref="ch.eugster.pos.db.ProductGroup" proxy="false" refresh="false"
> auto-retrieve="true" auto-update="false" auto-delete="false"
> otm-dependent="false">
>    	 	<foreignkey field-ref="productGroupId" />
>     </reference-descriptor>
> 
>     <reference-descriptor name="currentTax"
> class-ref="ch.eugster.pos.db.CurrentTax" proxy="false" refresh="false"
> auto-retrieve="true" auto-update="false" auto-delete="false"
> otm-dependent="false">
>    	 	<foreignkey field-ref="currentTaxId" />
>     </reference-descriptor>
> 
> </class-descriptor>
> 
> Payment:
> <class-descriptor class="ch.eugster.pos.db.Payment" table="pos_payment"
> isolation-level="read-uncommitted" accept-locks="true" refresh="false">
>     <field-descriptor name="id" column="id" jdbc-type="BIGINT"
> primarykey="true" indexed="true" access="readwrite" autoincrement="true"
> nullable="true" locking="false" update-lock="true" default-fetch="false" />
>     <field-descriptor name="receiptId" column="receipt_id"
> jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="paymentTypeId" column="payment_type_id"
> jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="foreignCurrencyId" column="foreign_currency_id"
> jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="quotation" column="quotation" jdbc-type="DOUBLE"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="amount" column="amount" jdbc-type="DOUBLE"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="amountFC" column="amount_fc" jdbc-type="DOUBLE"
> primarykey="false" nullable="true" indexed="false" autoincrement="false"
> locking="false" update-lock="true" default-fetch="false" access="readwrite"
> />
>     <field-descriptor name="roundFactor" column="round_factor"
> jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
>     <field-descriptor name="roundFactorFC" column="round_factor_fc"
> jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false"
> autoincrement="false" locking="false" update-lock="true"
> default-fetch="false" access="readwrite" />
> 
>     <reference-descriptor name="receipt"
> class-ref="ch.eugster.pos.db.Receipt" proxy="false" refresh="false"
> auto-retrieve="true" auto-update="false" auto-delete="false"
> otm-dependent="false">
>    	 	<foreignkey field-ref="receiptId" />
>     </reference-descriptor>
> 
>     <reference-descriptor name="paymentType"
> class-ref="ch.eugster.pos.db.PaymentType" proxy="false" refresh="false"
> auto-retrieve="true" auto-update="false" auto-delete="false"
> otm-dependent="false">
>    	 	<foreignkey field-ref="paymentTypeId" />
>     </reference-descriptor>
> 
>     <reference-descriptor name="foreignCurrency"
> class-ref="ch.eugster.pos.db.ForeignCurrency" proxy="false" refresh="false"
> auto-retrieve="true" auto-update="false" auto-delete="false"
> otm-dependent="false">
>    	 	<foreignkey field-ref="foreignCurrencyId" />
>     </reference-descriptor>
> 
> </class-descriptor>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org