-
1. Re: DB Update after a select
erikreut Jul 14, 2003 7:29 PM (in response to edross)Experienced the same experimenting with a simple CMR one-to-many relationshop using JBoss 3.2.1, where I never called any of the mutator methods on the entities.
If I changed the <commit-option> in standardjboss.xml for "Standard CMP 2.x EntityBean" from B to A (JBoss owns the database), performance increased, in my case, over 1000% pct.
Even though option A tells JBoss that it has exclusive access to the DB, it shouldn't do a commit to the DB unless an entity has actually changed with option B. It seems like they do some pretty aggressive caching with option A, but are too conservative with option B.
Anyone any thoughts? -
2. Re: DB Update after a select
edross Jul 14, 2003 7:57 PM (in response to edross)WOW! I didn't even know that option exited. Thanks See an incredible change (From 69 transactions/Minute 245/Second) Using apache JMeter
-
3. Re: DB Update after a select
samart Jul 30, 2003 10:23 AM (in response to edross)I'm wondering about this also. does anyone know how to disable the update after select when using cmr? i'm using commit option a...
Thanks,
trevor -
4. Re: DB Update after a select
samart Jul 30, 2003 11:34 AM (in response to edross)this is bug #699938 which was closed on march 19. however, its still there in 3.2.1.
is there a way i can patch 3.2.1 to fix this now? its a major performance bottleneck. -
5. Re: DB Update after a select
tedlong Aug 8, 2003 10:03 AM (in response to edross)This is also causing us big problems. I found it because our datasource (SQLServer) is taking increasingly more time to do an update by primary key as the tables are growing... this is a separate issue.
If there is a work-around I'd like to know what it is. In the meantime I think I'll try out 3.2.2RC2. -
6. Re: DB Update after a select
nekro Aug 17, 2003 4:04 AM (in response to edross)Hello TedLong,
Please, tell me, what workaround do you have for the problem you mentioned : "more time to do an update by primary key as the tables are growing"??
This is somehting that I am also encountering, but with MySQL...Is there anything to be done? I know for sure it is not related to commit options or transaction settings, it is just related to the table size....when the table is almost empty, all runs fine, but performance goes down as the tables increase. -
7. Re: DB Update after a select
rudifr Mar 1, 2004 12:30 PM (in response to edross)Hi,
has anyone found a workaround for this problem so far?
I'm using JBoss 3.2.3 and Oracle 9i and there are happening UPDATES in finder methods after the SELECT.
This causes huge deadlock problems in the database (ORA-00060).
I switched to the "1 instance per transaction" configuration to avoid the JBoss deadlocks and now I'm getting deadlocks in the database.
Is it possible to switch off the UPDATES somehow?
Any help would be appreciated. -
8. Re: DB Update after a select
aloubyansky Mar 1, 2004 10:29 PM (in response to edross)What is your code doing? What fields are updated? What are types the types of those fields?
-
9. Re: DB Update after a select
sago Mar 2, 2004 12:50 PM (in response to edross)I have the same problem using jboss 3.2.3 and oracle 9i. CMR field UPDATES are executed after SELECTS.
-
10. Re: DB Update after a select
rudifr Mar 2, 2004 1:20 PM (in response to edross)All java.util.Date fields are updated. In Oracle9i they are TIMESTAMP(3).
I've found a workaround for this problem in this forum:
In jbosscmp-jdbc.xml, set <check-dirty-after-get> to false for your non-primitive CMP fields.
<cmp-field>
<field-name>shipDate</field-name>
<column-name>ship_date</column-name>
<not-null/>
<jdbc-type>DATE</jdbc-type>
<sql-type>DATE</sql-type>
<check-dirty-after-get>false</check-dirty-after-get>
</cmp-field>
It works great and I didn't have a deadlock since I set <check-dirty-after-get> to false for the Date fields. The problem with it is that I have to do it for every single field and that I can't do it with XDoclet. So I have to patch jbosscmp-jdbc.xml after every run of XDoclet.
Does anybody know, why JBoss does these updates? If it's not a bug a switch to turn it off generally would be very helpful. -
11. Re: DB Update after a select
darklord Mar 30, 2004 4:34 AM (in response to edross)Guys,
Sounds we have the same problem with postgresql (especially the instance per transaction -> deadlock on the database).
Regarding the Xdoclet problem I will submit a patch to Xdoclet that will add this tag.
I will keep you posted.
Regards,
Stephane -
12. Re: DB Update after a select
lamarguy Mar 30, 2004 7:50 PM (in response to edross)actually they fixed the incorrect update for Date fields in 3.2.4RC1 which eliminates the need for check-dirty-after-get. see the notes at http://sourceforge.net/project/shownotes.php?release_id=223319
use JDBCTypeFactory.EQUALS state factory for date types. fix for [ 864871 ] CMP evals java.sql.Date and java.sql.Timestamp as dirty
as for XDoclet, I submitted a patch over 3 weeks ago which was never merged. oy vey... -
13. Re: DB Update after a select
stephanenicoll Mar 31, 2004 12:43 AM (in response to edross)That one?
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-836
I don't see any patch there