Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 50718 invoked from network); 3 Oct 2003 17:56:46 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Oct 2003 17:56:46 -0000 Received: (qmail 24445 invoked by uid 500); 3 Oct 2003 17:56:36 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 24422 invoked by uid 500); 3 Oct 2003 17:56:36 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 24409 invoked from network); 3 Oct 2003 17:56:36 -0000 Received: from unknown (HELO smtp0.atl.equifax.com) (216.46.96.116) by daedalus.apache.org with SMTP; 3 Oct 2003 17:56:36 -0000 Received: from postoffice-2.equifax.com (postoffice-2.equifax.com [192.168.4.11]) by smtp0.atl.equifax.com (Postfix) with ESMTP id C748F1AAE for ; Fri, 3 Oct 2003 13:56:38 -0400 (EDT) Received: from wetcmail1.fin.equifax.com (wetcmail1.fin.equifax.com [172.18.97.58]) by postoffice-2.equifax.com (Postfix) with ESMTP id 7202A4C9BB for ; Fri, 3 Oct 2003 13:56:40 -0400 (EDT) Subject: Question about transaction rollback To: ojb-dev@db.apache.org X-Mailer: Lotus Notes Release 5.0.10 March 22, 2002 Message-ID: From: Dave.Derry@Equifax.com Date: Fri, 3 Oct 2003 13:57:31 -0400 X-MIMETrack: Serialize by Router on WETCMAIL1/Equifax(Release 5.0.10 |March 22, 2002) at 10/03/2003 01:57:33 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, I just upgraded from RC1 to RC4, and have encountered unit test failures. Now these are NOT OJB unit tests; but the unit tests for our project. The problem (at least in the one case that I have examined so far) is the result of an aborted transaction. I've traced the problem to the addition in StateOldDirty#rollback(ObjectEnvelope mod, PersistenceBroker broker) of the following line: mod.rollback(); ObjectEnvelope#rollback() then attempts to restore the state of the object. Although I applaud this attempt, I have 2 concerns with this approach. ObjectEnvelope #rollback() is only able to restore fields that are included in the class descriptor; any transient fields that may have been changed will not be restored. Looking at the ObjectEnvelope#rollback() code shows that you don't have an answer for my second concern, which is, how do you rollback a collection? But to address my first concern. I have reviewed Klaasjan Brand's message regarding inconsistency of cached objects after a rollback, and certainly understand his concern. But, although his patch, helps to alleviate the problem, he has not solved the problem, for the reasons I stated above. Unless we can guarantee that an object is fully restored to it's pre-modification state, it is safer to flush the object from the cache (as we have done on my current project). Now granted, the unit test failure that I mentioned is caused by our expectation of the old behavior, and is merely due to the fact that we assert that the object has been modified. But since it has been flushed from the cache, it is only through a 'dangling' reference that we can even see it. So my unit test failure (at least this one) isn't a big concern for me. It's just that the failure got me looking for what had changed, and when I found it I had to question the validity of the change. True, this change may actually effect a rollback in a large percentage of cases, but it could result in subtle problems in the remaining cases. Is it possible to do better? My 2 cents, Dave Derry --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org