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 dennis bekkering <dj...@hotmail.com> on 2004/06/15 04:05:42 UTC
a lot of delete statements on insert m:n rc7
Hello,
I have a simple unit test class :
public static String id;
public AppointmentDelegateTest(String arg0)
throws Exception
{
super(arg0);
Appointment appointment = new Appointment();
User user = new User();
appointment.setUser(user);
appointment.setCreationDate( new java.util.Date() );
appointment.put();
GenericDelegate.getInstance().clearCache();
id = appointment.getId().toString();
}
PersistenceBroker broker ;
protected void setUp() throws Exception
{
super.setUp();
try{
broker = PersistenceBrokerFactory.defaultPersistenceBroker();
}
catch (PBFactoryException e)
{
}
protected void tearDown() throws Exception
{
super.tearDown();
broker.close();
}
public void testGetAppointment()
throws Exception
{
Criteria criteria = new Criteria();
criteria.addEqualTo("id", new Integer(id));
Query q = QueryFactory.newQuery( Appointment.class , criteria);
Appointment appointment = (Appointment) broker.getObjectByQuery(q);
assertNotNull( appointment );
}
---------------------------
the sql debug output =
-------------------------
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:INSERT INTO Appointment
(longdescription,noofattachement,shortdescription,userid,totime,fromtime,id,
creationdate,location) VALUES (?,?,?,?,?,?,?,?,?)
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
.......[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl]
DEBUG: SQL:SELECT
A0.userid,A0.longdescription,A0.totime,A0.fromtime,A0.location,A0.noofattach
ement,A0.creationdate,A0.id,A0.shortdescription FROM Appointment A0 WHERE
A0.id = ?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:SELECT password,logname,usercontactid,id FROM User WHERE id = ?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:SELECT
A0.gender,A0.phone,A0.mailheader,A0.title,A0.type,A0.function,A0.privat,A0.m
ailfooter,A0.id,A0.mobilephone,A0.companyid,A0.lastname,A0.userid,A0.middlen
ame,A0.searchname,A0.firstname,A0.online,A0.dateofbirth,A0.initials,A0.email
,A0.creationdate FROM Contact A0,Appointment2Contact WHERE
(Appointment2Contact.appointmentId = ?) AND Appointment2Contact.contactId =
A0.id
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:SELECT A0.originalfilename,A0.filename,A0.id FROM Attachement
A0,Appointment2Attachement WHERE (Appointment2Attachement.appointmentid = ?)
AND Appointment2Attachement.attachementId = A0.id
My question is why it contains so many delete staments and why i see
suddenly Result of getTableAlias(): null. I did not see this in rc6. It is
not giving trouble but it looks strange to me.
the appointment descriptor =
<class-descriptor class="nl.salesmakers.model.Appointment"
table="Appointment">
<field-descriptor id="18" name="longDescription" column="longdescription"
jdbc-type="LONGVARCHAR"/>
<field-descriptor id="19" name="noOfAttachement" column="noofattachement"
jdbc-type="INTEGER"/>
<field-descriptor id="20" name="shortDescription" column="shortdescription"
jdbc-type="VARCHAR"/>
<field-descriptor id="22" name="userId" column="userid"
jdbc-type="INTEGER"/>
<field-descriptor id="23" name="toTime" column="totime"
jdbc-type="TIMESTAMP"/>
<field-descriptor id="24" name="fromTime" column="fromtime"
jdbc-type="TIMESTAMP"/>
<field-descriptor id="25" name="id" column="id" jdbc-type="INTEGER"
primarykey="true" autoincrement="true"/>
<field-descriptor id="26" name="creationDate" column="creationdate"
jdbc-type="DATE"/>
<reference-descriptor name="user" class-ref="nl.salesmakers.model.User">
<foreignkey field-ref="userId"/>
</reference-descriptor>
<collection-descriptor name="contactList"
element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
auto-update="true" auto-delete="false"
indirection-table="Appointment2Contact">
<fk-pointing-to-this-class column="appointmentId"/>
<fk-pointing-to-element-class column="contactId"/>
</collection-descriptor>
<collection-descriptor name="attachementList"
element-class-ref="nl.salesmakers.model.AttacheMent" auto-retrieve="true"
auto-update="true" auto-delete="false"
indirection-table="Appointment2Attachement">
<fk-pointing-to-this-class column="appointmentid"/>
<fk-pointing-to-element-class column="attachementId"/>
</collection-descriptor>
<field-descriptor name="location" column="location" jdbc-type="VARCHAR"/>
</class-descriptor>
thanks,
Dennis
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: AW: Duplicate key error when inserting a new record
Posted by Armin Waibel <ar...@apache.org>.
Hi,
> 14.06.2004 09:41:31 ch.eugster.pos.db.Table describeError
> SCHWERWIEGEND: Can not init Identity for given object
> ch.eugster.pos.db.Position@105a248
ok, this means that the Identity object couldn't be created. You do an
insert, thus I assume that the sequence manager has a problem in lookup
the next sequence.
Is this the whole stack trace you get?
No other logging messages before that?
regards,
Armin
Christian Eugster wrote:
> Hi Armin,
>
>
>>hmm difficult to say what's going wrong. I can't find metadata for
>>'ch.eugster.pos.db.DBResult' class or what does this entry mean?
>
>
> DBResult is just an object that capsulate the information a transaction is
> providing me. As following:
>
> DBResult result = receipt.store();
>
> if receipt.store() returns an errorcode, DBResult logs this to my logger.
> The relevant metadata are those i provided in my mail.
>
> The situation is, that some clients are - as a load-test - inserting
> concurrently records in the same db over a network. all clients use ojb (as
> i mentioned before rc5). Sometimes i get also the following error:
>
> 14.06.2004 09:41:31 ch.eugster.pos.db.Table describeError
> SCHWERWIEGEND: Can not init Identity for given object
> ch.eugster.pos.db.Position@105a248
>
> where ch.eugster.pos.db.Table is the abstract superclass of
> ch.eugster.pos.db.Position.
>
> Does this information help you?
>
> Thank you and regards
>
> Christian
>
>
> ---------------------------------------------------------------------
> 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: Duplicate key error when inserting a new record
Posted by Christian Eugster <ch...@bluewin.ch>.
Hi Armin,
> hmm difficult to say what's going wrong. I can't find metadata for
> 'ch.eugster.pos.db.DBResult' class or what does this entry mean?
DBResult is just an object that capsulate the information a transaction is
providing me. As following:
DBResult result = receipt.store();
if receipt.store() returns an errorcode, DBResult logs this to my logger.
The relevant metadata are those i provided in my mail.
The situation is, that some clients are - as a load-test - inserting
concurrently records in the same db over a network. all clients use ojb (as
i mentioned before rc5). Sometimes i get also the following error:
14.06.2004 09:41:31 ch.eugster.pos.db.Table describeError
SCHWERWIEGEND: Can not init Identity for given object
ch.eugster.pos.db.Position@105a248
where ch.eugster.pos.db.Table is the abstract superclass of
ch.eugster.pos.db.Position.
Does this information help you?
Thank you and regards
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Duplicate key error when inserting a new record
Posted by Armin Waibel <ar...@apache.org>.
Hi Christian,
hmm difficult to say what's going wrong. I can't find metadata for
'ch.eugster.pos.db.DBResult' class or what does this entry mean?
regards,
Armin
Christian Eugster wrote:
> Hi!
>
> I use OJB-1.0rc5 with a mysql (innodb) as backend. When we insert
> concurrently objects that have two 1:n-relations into the same table
> pos_receipt from e.g. 4 clients, we get the following
> duplicate-primary-key-message:
>
> 14.06.2004 09:40:47 ch.eugster.pos.db.DBResult log
> SCHWERWIEGEND: 23000: Duplicate key or integrity constraint violation,
> message from server: "Duplicate entry '1822' for key 1"
>
> ojb increments the primarykey (Long).
>
> Has anybody an idea, what I am doing wrong?
>
> Thank your!
>
> Christian
>
>
> the repository connection-descriptor looks like this:
>
> -------------------
> ...
> <jdbc-connection-descriptor jcd-alias="standard"
> default-connection="false" platform="mySQL" jdbc-level="3.0"
> driver="com.mysql.jdbc.Driver" protocol="jdbc" subprotocol="mysql"
> dbalias="//salespoint:3306/colibri" username="colibri" password="colibri"
> batch-mode="false" useAutoCommit="2" eager-release="false"
> ignoreAutoCommitExceptions="false">
>
> <connection-pool maxActive="5" validationQuery="" />
>
> <sequence-manager
> className="org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl">
> <attribute attribute-name="grabSize" attribute-value="5" />
> </sequence-manager>
> </jdbc-connection-descriptor>
> ...
> -------------------
>
> the class-descriptors look like this:
>
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> pos_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"
> />
>
> <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>
>
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>
> <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>
>
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>
> <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>
>
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>
>
>
> ---------------------------------------------------------------------
> 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
Duplicate key error when inserting a new record
Posted by Christian Eugster <ch...@bluewin.ch>.
Hi!
I use OJB-1.0rc5 with a mysql (innodb) as backend. When we insert
concurrently objects that have two 1:n-relations into the same table
pos_receipt from e.g. 4 clients, we get the following
duplicate-primary-key-message:
14.06.2004 09:40:47 ch.eugster.pos.db.DBResult log
SCHWERWIEGEND: 23000: Duplicate key or integrity constraint violation,
message from server: "Duplicate entry '1822' for key 1"
ojb increments the primarykey (Long).
Has anybody an idea, what I am doing wrong?
Thank your!
Christian
the repository connection-descriptor looks like this:
-------------------
...
<jdbc-connection-descriptor jcd-alias="standard"
default-connection="false" platform="mySQL" jdbc-level="3.0"
driver="com.mysql.jdbc.Driver" protocol="jdbc" subprotocol="mysql"
dbalias="//salespoint:3306/colibri" username="colibri" password="colibri"
batch-mode="false" useAutoCommit="2" eager-release="false"
ignoreAutoCommitExceptions="false">
<connection-pool maxActive="5" validationQuery="" />
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl">
<attribute attribute-name="grabSize" attribute-value="5" />
</sequence-manager>
</jdbc-connection-descriptor>
...
-------------------
the class-descriptors look like this:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
pos_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"
/>
<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>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<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>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<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>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: a lot of delete statements on insert m:n rc7
Posted by dennis bekkering <dj...@hotmail.com>.
there i am again , setting collection-class=managableList solved all the
deleteting so forget about my question please. I still see Result of
getTableAlias(): null though , what does it mean?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:INSERT INTO Appointment
(longdescription,noofattachement,shortdescription,userid,totime,fromtime,id,
creationdate,location) VALUES (?,?,?,?,?,?,?,?,?)
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:SELECT
A0.userid,A0.longdescription,A0.totime,A0.fromtime,A0.location,A0.noofattach
ement,A0.creationdate,A0.id,A0.shortdescription FROM Appointment A0 WHERE
A0.id = ?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:SELECT password,logname,usercontactid,id FROM User WHERE id = ?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:SELECT
A0.gender,A0.phone,A0.mailheader,A0.title,A0.type,A0.function,A0.privat,A0.m
ailfooter,A0.id,A0.mobilephone,A0.companyid,A0.lastname,A0.userid,A0.middlen
ame,A0.searchname,A0.firstname,A0.online,A0.dateofbirth,A0.initials,A0.email
,A0.creationdate FROM Contact A0,Appointment2Contact WHERE
(Appointment2Contact.appointmentId = ?) AND Appointment2Contact.contactId =
A0.id
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
Result of getTableAlias(): null
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
SQL:SELECT A0.originalfilename,A0.filename,A0.id FROM Attachement
A0,Appointment2Attachement WHERE (Appointment2Attachement.appointmentid = ?)
AND Appointment2Attachement.attachementId = A0.id
Time: 0,591
OK (1 test)
gr,
Dennis
----- Original Message -----
From: "dennis bekkering" <dj...@hotmail.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Tuesday, June 15, 2004 4:05 AM
Subject: a lot of delete statements on insert m:n rc7
> Hello,
>
> I have a simple unit test class :
>
>
>
> public static String id;
>
>
> public AppointmentDelegateTest(String arg0)
>
> throws Exception
>
> {
>
> super(arg0);
>
> Appointment appointment = new Appointment();
>
>
>
> User user = new User();
>
> appointment.setUser(user);
>
> appointment.setCreationDate( new java.util.Date() );
>
> appointment.put();
>
> GenericDelegate.getInstance().clearCache();
>
> id = appointment.getId().toString();
>
> }
>
> PersistenceBroker broker ;
>
> protected void setUp() throws Exception
>
> {
>
> super.setUp();
>
> try{
>
> broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>
> }
>
> catch (PBFactoryException e)
>
> {
>
> }
>
> protected void tearDown() throws Exception
>
> {
>
>
> super.tearDown();
>
> broker.close();
>
> }
>
> public void testGetAppointment()
>
> throws Exception
>
> {
>
> Criteria criteria = new Criteria();
>
> criteria.addEqualTo("id", new Integer(id));
>
> Query q = QueryFactory.newQuery( Appointment.class , criteria);
>
> Appointment appointment = (Appointment) broker.getObjectByQuery(q);
>
>
> assertNotNull( appointment );
>
> }
>
> ---------------------------
>
> the sql debug output =
>
> -------------------------
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:INSERT INTO Appointment
>
(longdescription,noofattachement,shortdescription,userid,totime,fromtime,id,
> creationdate,location) VALUES (?,?,?,?,?,?,?,?,?)
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Contact WHERE appointmentId=?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:DELETE FROM Appointment2Attachement WHERE appointmentid=?
>
> .......[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl]
> DEBUG: SQL:SELECT
>
A0.userid,A0.longdescription,A0.totime,A0.fromtime,A0.location,A0.noofattach
> ement,A0.creationdate,A0.id,A0.shortdescription FROM Appointment A0 WHERE
> A0.id = ?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:SELECT password,logname,usercontactid,id FROM User WHERE id = ?
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> Result of getTableAlias(): null
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> Result of getTableAlias(): null
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> Result of getTableAlias(): null
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> Result of getTableAlias(): null
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:SELECT
>
A0.gender,A0.phone,A0.mailheader,A0.title,A0.type,A0.function,A0.privat,A0.m
>
ailfooter,A0.id,A0.mobilephone,A0.companyid,A0.lastname,A0.userid,A0.middlen
>
ame,A0.searchname,A0.firstname,A0.online,A0.dateofbirth,A0.initials,A0.email
> ,A0.creationdate FROM Contact A0,Appointment2Contact WHERE
> (Appointment2Contact.appointmentId = ?) AND Appointment2Contact.contactId
=
> A0.id
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> Result of getTableAlias(): null
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> Result of getTableAlias(): null
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> Result of getTableAlias(): null
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> Result of getTableAlias(): null
>
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:SELECT A0.originalfilename,A0.filename,A0.id FROM Attachement
> A0,Appointment2Attachement WHERE (Appointment2Attachement.appointmentid =
?)
> AND Appointment2Attachement.attachementId = A0.id
>
>
>
> My question is why it contains so many delete staments and why i see
> suddenly Result of getTableAlias(): null. I did not see this in rc6. It is
> not giving trouble but it looks strange to me.
>
> the appointment descriptor =
>
> <class-descriptor class="nl.salesmakers.model.Appointment"
> table="Appointment">
>
> <field-descriptor id="18" name="longDescription" column="longdescription"
> jdbc-type="LONGVARCHAR"/>
>
> <field-descriptor id="19" name="noOfAttachement" column="noofattachement"
> jdbc-type="INTEGER"/>
>
> <field-descriptor id="20" name="shortDescription"
column="shortdescription"
> jdbc-type="VARCHAR"/>
>
> <field-descriptor id="22" name="userId" column="userid"
> jdbc-type="INTEGER"/>
>
> <field-descriptor id="23" name="toTime" column="totime"
> jdbc-type="TIMESTAMP"/>
>
> <field-descriptor id="24" name="fromTime" column="fromtime"
> jdbc-type="TIMESTAMP"/>
>
> <field-descriptor id="25" name="id" column="id" jdbc-type="INTEGER"
> primarykey="true" autoincrement="true"/>
>
> <field-descriptor id="26" name="creationDate" column="creationdate"
> jdbc-type="DATE"/>
>
> <reference-descriptor name="user" class-ref="nl.salesmakers.model.User">
>
> <foreignkey field-ref="userId"/>
>
> </reference-descriptor>
>
> <collection-descriptor name="contactList"
> element-class-ref="nl.salesmakers.model.Contact" auto-retrieve="true"
> auto-update="true" auto-delete="false"
> indirection-table="Appointment2Contact">
>
> <fk-pointing-to-this-class column="appointmentId"/>
>
> <fk-pointing-to-element-class column="contactId"/>
>
> </collection-descriptor>
>
> <collection-descriptor name="attachementList"
> element-class-ref="nl.salesmakers.model.AttacheMent" auto-retrieve="true"
> auto-update="true" auto-delete="false"
> indirection-table="Appointment2Attachement">
>
> <fk-pointing-to-this-class column="appointmentid"/>
>
> <fk-pointing-to-element-class column="attachementId"/>
>
> </collection-descriptor>
>
> <field-descriptor name="location" column="location" jdbc-type="VARCHAR"/>
>
> </class-descriptor>
>
> thanks,
>
> 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