Hi Josef,
>
> I have no idee, why my application takes 20 ms per object to store :o(
OJB is shipped with a simple multi-threaded test similar to your test.
Your can run this test out of the box against hsql, see
http://db.apache.org/ojb/docu/guides/performance.html#OJB+performance+in+multi-threaded+environments
Against hsql in-memory it takes a few ms to store an object, against
MaxDB it takes 24ms (mass test, batch-mode disabled, no statement pooling).
For upcoming OJB 1.0.5 I rewrote this document and made additional
performance test. With statement pooling enabled, batch mode enabled and
fastest PersistentField implementation it takes about 4ms to store one
object in multithreaded mass test against MaxDB.
So it strongly depends on the used configuration.
> I also wondering, that OJB stores bevor committing the transaction.
The PB-api does immediately execute all DB calls, no unit-of-work
concept is used (in contrast to odmg-api).
regards,
Armin
Josef Wagner wrote:
Hello Armin,
you have written in the mailing list, that it takes around 20 sec. to store
10000 objects (is 0,5 obj in 1 ms.).
(http://mail-archives.apache.org/mod_mbox/db-ojb-user/200408.mbox/%3C411780E
[EMAIL PROTECTED])
In my testszenario, when I logging width timestamp before calling store and
also after storing, I see a difference from at least 10 ms till 50 ms for
each object.
Here my szenario
###########################
# repository_language.xml #
###########################
<class-descriptor
class="de.on_ergy.lakon.data.model.Language"
table="language">
<field-descriptor name="objId" column="obj_id" jdbc-type="INTEGER"
primarykey="true"></field-descriptor>
<field-descriptor name="lang" column="lang " jdbc-type="CHAR"
length="5"></field-descriptor>
<field-descriptor name="langDesc" column="lang_desc" jdbc-type="CHAR"
length="30"></field-descriptor>
<field-descriptor name="langCode" column="lang_code" jdbc-type="CHAR"
length="4"></field-descriptor>
<field-descriptor name="activ" column="activ" jdbc-type="BOOLEAN"
</field-descriptor>
</class-descriptor>
##################
# java test code #
##################
broker = getBroker();
log.info("start begin transaction -> " + new Timestamp(new
Date().getTime()));
broker.beginTransaction();
log.info("end beginn transaction -> " + new Timestamp(new
Date().getTime()));
for (int i = 1; i <= 10; i++) {
log.info("start store -> " + new Timestamp(new Date().getTime()));
Language lang = new Language();
lang.setObjId(new Integer(i));
lang.setLang("TE_ST");
lang.setLangDesc("description");
lang.setLangCode("ENG");
lang.setActiv(new Boolean(true));
broker.store(lang);
log.info("end store -> " + new Timestamp(new Date().getTime()));
}
log.info("start commit transaction -> " + new Timestamp(new
Date().getTime()));
broker.commitTransaction();
log.info("end commit transaction -> " + new Timestamp(new
Date().getTime()));
##################
# logging output #
##################
Start beginn transaktion -> 2006-05-17 13:23:41.688
End beginn transaktion -> 2006-05-17 13:23:41.698
Start broker store -> 2006-05-17 13:23:41.698
Specified cache class org.apache.ojb.broker.cache.ObjectCacheEmptyImpl does
not implement interface org.apache.ojb.broker.cache.ObjectCacheInternal and
will be wrapped by a helper class
End broker store -> 2006-05-17 13:23:41.748
Start broker store -> 2006-05-17 13:23:41.748
End broker store -> 2006-05-17 13:23:41.769
Start broker store -> 2006-05-17 13:23:41.769
End broker store -> 2006-05-17 13:23:41.799
Start broker store -> 2006-05-17 13:23:41.799
End broker store -> 2006-05-17 13:23:41.809
Start broker store -> 2006-05-17 13:23:41.809
End broker store -> 2006-05-17 13:23:41.819
Start broker store -> 2006-05-17 13:23:41.829
End broker store -> 2006-05-17 13:23:41.839
Start broker store -> 2006-05-17 13:23:41.839
End broker store -> 2006-05-17 13:23:41.869
Start broker store -> 2006-05-17 13:23:41.869
End broker store -> 2006-05-17 13:23:41.879
Start broker store -> 2006-05-17 13:23:41.899
Start creating new ObjectCache instance
Instantiate new org.apache.ojb.broker.cache.CacheDistributor for PB instance
[EMAIL PROTECTED]
New ObjectCache instance was created
Specified cache class org.apache.ojb.broker.cache.ObjectCacheEmptyImpl does
not implement interface org.apache.ojb.broker.cache.ObjectCacheInternal and
will be wrapped by a helper class
End broker store -> 2006-05-17 13:23:42.019
Start commit transaktion -> 2006-05-17 13:23:42.039
End commit transaktion -> 2006-05-17 13:23:42.039
I have no idee, why my application takes 20 ms per object to store :o(
I also wondering, that OJB stores bevor committing the transaction.
I Developing an Eclipse RCP width hsqldb and postgres and OJB 1.0.3
Thanks a lot for your help!
Josef Wagner
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]