We have experimented the load (class obj.class, object id, object obj) experimental method of Database interface.
We want to tell you that this method is very useful however it is an experimental method.
Context of using it:
Platform:
- Apache Tomcat 4.01
- Castor 0.9.5.2
- Struts
Why we use this method:
We have one transaction that is alive during many http requests. During this transaction we have to create objects in database, read objects from this database, update objects &.
Actually, everything is working fine for a single user. In our application two users cant access the same instance at the same time. However problems occur when two users use the application.
Actually when creating an object, a lock appears on the tables used for this creation. So the second user is blocked until the first one leave his transaction. Then the second can starts its. Its really annoying because a transaction is alive during many http request and can spend a long time, the application is blocked for other users.
We have solved the problem by having many transactions. Small ones for creations and a main one for updating.
The main transaction is alive during many http requests. Each times an new object is created, we use a small independent transaction that we begin, commit and close. Then the created object is loaded using the experimental method load(class obj.class, object id, object obj) to mount it on persistence in order to be able to update it during the main transaction.
Antoine Guerrand and Mathias Lagu�rie
begin:vcard fn;quoted-printable:Mathias Lagu=C3=A9rie n;quoted-printable:Lagu=C3=A9rie;Mathias org:ECOLOCALE adr:;;12, avenue Janvier;RENNES;;35 000;FRANCE email;internet:[EMAIL PROTECTED] title:Chef de projets informatiques tel;work:02 99 67 76 76 version:2.1 end:vcard
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
