From dev-return-14913-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Nov 01 19:34:03 2007 Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 48729 invoked from network); 1 Nov 2007 19:34:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Nov 2007 19:34:03 -0000 Received: (qmail 93343 invoked by uid 500); 1 Nov 2007 19:27:42 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 93317 invoked by uid 500); 1 Nov 2007 19:27:42 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 93304 invoked by uid 99); 1 Nov 2007 19:27:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2007 12:27:42 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of esteban.franqueiro@bea.com designates 66.248.222.89 as permitted sender) Received: from [66.248.222.89] (HELO rcpmmg01.bea.com) (66.248.222.89) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2007 19:28:03 +0000 Received: from rcpmmr01.bea.com (rcpmmr01.bea.com [10.168.29.71]) by rcpmmg01.bea.com (Switch-3.3.0/Switch-3.2.7) with ESMTP id lA1JRMaX018364 for ; Thu, 1 Nov 2007 12:27:22 -0700 Received: from goku ([10.36.9.115]) by rcpmmr01.bea.com (Switch-3.3.0/Switch-3.2.7) with SMTP id lA1JRJoF032260 for ; Thu, 1 Nov 2007 12:27:20 -0700 Message-ID: <04c901c81cbd$390ed850$7309240a@goku> From: "Esteban Franqueiro" To: References: <1414276.1193917790655.JavaMail.jira@brutus> Subject: Re: [jira] Commented: (JCR-1154) Database Data Store Date: Thu, 1 Nov 2007 16:27:19 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.3790.1830 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 x-BEA-PMX-Instructions: AV x-BEA-MM: Internal-To-External X-Virus-Checked: Checked by ClamAV on apache.org Hi Thomas. > - please use spaces, not tabs (Jackrabbit consistently uses spaces) > - please don't use import ...* > - byte b[] > byte[] b > - public is not required in interfaces > - return does not require (..) > > To fix such problems, I use Checkstyle. If you like I can post the configuration I use. Sure, please do that. How do you run checkstyle? > Garbage collection: I like make garbage collection implementation independent; is it OK for you if > I remove those cases? Sorry, which cases? > AbstractGarbageCollector and AbstractDataStore are not required then (anyway they are small). The AbstractDataStore class has members that are common to both data stores, and are implementation independent. It can be removed, but we'll en up with a lot of duplicated code in both subclasses. On the other hand, the AbstractGarbageCollector is easier, the only difference is that FileGarbageCollector overrides touchBinaryProperty(), which is different. I guess you can merge both methods in one that calls back to the data store impl to update the record's time, but the way I see it now is probably more complicated. Maybe you can tell me your idea on how to do this, so I can understand better. > It would be great if the database data store would automatically re-connect if the connection was > lost (important for MySQL). To achieve this, > org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager can be used. This is our point of most concern. The problem is that if we follow in the data store the pattern used in the PMs (only one connection), it won't be possible to have multiple clients concurrently uploading binaries. That's why we did it that way. Still, we don't think that adding reconnection is going to be a problem, but what concerns us is that doing so forces the one connection pattern. In our app we subclass the DatabaseDataStore class and override the getConection(boolean) method to use a connection pool provided by the DataDirect JDBC drivers. > It's quite tricky that DatabaseRecord extends FilterInputStream... However I'm not sure if it is > required, is it not possible to just wrap the database BLOB object? Yes, not only tricky but also very ugly. We had to it like that because the way our application handles the binaries. But alas, we fixed that already. I'll send the changes as soon as I figure out how to make a decent patch. > I don't think that FileDataStoreConstants is required. You're right, their just a leftover. Although I do think that the buffer size in FileDataStore should be added as a constant, and maybe increased to 16 or 64KB > Those are just my view, and I'm open to discuss them of course. > If you have time to change it yourself please go ahead. Otherwise I will do it and post the patch > here before I commit it - but it will take a few more days. Do you have a patch against trunk? If you do, please upload it, so I can update it with our latest changes and test cases. After that I'll have no problem in doing these. Looking at the ConnectionRecoveryManager, I think that its private methods should be delcared as protected instead of private, because it should be possible to override them. Regards, Esteban Franqueiro esteban.franqueiro@bea.com Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.