Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 58440 invoked from network); 21 Aug 2008 14:16:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2008 14:16:02 -0000 Received: (qmail 3882 invoked by uid 500); 21 Aug 2008 14:15:55 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 3862 invoked by uid 500); 21 Aug 2008 14:15:55 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 3851 invoked by uid 99); 21 Aug 2008 14:15:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2008 07:15:54 -0700 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [18.62.0.45] (HELO mtl.mit.edu) (18.62.0.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2008 14:14:57 +0000 Received: from westgate-five-sixty-four.mit.edu ([18.98.7.53]) by mtl.mit.edu with asmtp (TLSv1:AES256-SHA:256) (Exim 4.34) id 1KWAsJ-0002Xf-M1 for user-java@ibatis.apache.org; Thu, 21 Aug 2008 10:10:55 -0400 Message-ID: <48AD776B.9090802@mtl.mit.edu> Date: Thu, 21 Aug 2008 10:10:51 -0400 From: Jonathan Slate User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: Re: passing in java date References: <48AD664E.6090507@mtl.mit.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MTL-MailServer: Found to be clean X-MTL-MailServer-From: jslate@mtl.mit.edu X-Virus-Checked: Checked by ClamAV on apache.org Okay, so you mean and AOP proxy, right? Thanks for the suggestion. It doesn't seem like that's documented much, looking at the mailing list archives I'm guessing my best bet would be to download the iBATIS source and see how you guys are doing the logging stuff, right? I don't know, I'm guessing this is going to be more work than it is worth for me in the long run. But if there are some decent examples maybe I'll give it a try, or would it be helpful if I did it and wrote it up for others? Not sure if this is something other people would need. If I *did* do this, would it make more sense to pass in the date as part of the parameterObject or as a property? It looks like the properties (java.util.Properties) get passed to the SqlMapClientBuilder which builds the SqlMapClient, so I'm thinking that once the SqlMapClient is built, those properties are essentially unmodifiable. Or I could do before advice for all the methods that take a parameterObject to create a map, setting a "currentTime" value and... hm... "parameterObject" value? ...well, I think I'd have some things to work out there. Maybe I'm missing something obvious here. :) Thanks again, Jonathan Larry Meadors wrote: > Put a proxy on the sql map client interface. > > Larry > > > On Thu, Aug 21, 2008 at 6:57 AM, Jonathan Slate wrote: > >> Hi: >> >> We were having some problems where the time on the Web server and the DB >> server are off by a few milliseconds and it was causing some issues, so >> rather than rely on getting the times synched perfectly, I thought we could >> just always use the time on the Web server by passing in the current time >> when querying. >> >> I could change all of our "getSqlMapClientTemplate()..." calls to pass in a >> map that includes the current java date/time, but that would be a lot of >> work (and I'm lazy). So I was trying to find a way to always make "now" >> available to my SQL maps. >> >> For example: >> SELECT * FROM foo WHERE start_time <= ${now} >> >> I know I can use static properties from a properties file like this. Is >> there a way to do this for something more dynamic like "current time?" >> >> Thanks, >> Jonathan >> >>