Return-Path: X-Original-To: apmail-cayenne-dev-archive@www.apache.org Delivered-To: apmail-cayenne-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 71BB910528 for ; Tue, 24 Sep 2013 19:51:32 +0000 (UTC) Received: (qmail 19553 invoked by uid 500); 24 Sep 2013 19:51:08 -0000 Delivered-To: apmail-cayenne-dev-archive@cayenne.apache.org Received: (qmail 18938 invoked by uid 500); 24 Sep 2013 19:51:00 -0000 Mailing-List: contact dev-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list dev@cayenne.apache.org Received: (qmail 18752 invoked by uid 99); 24 Sep 2013 19:50:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Sep 2013 19:50:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mkienenb@gmail.com designates 74.125.82.47 as permitted sender) Received: from [74.125.82.47] (HELO mail-wg0-f47.google.com) (74.125.82.47) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Sep 2013 19:50:51 +0000 Received: by mail-wg0-f47.google.com with SMTP id f12so5210810wgh.14 for ; Tue, 24 Sep 2013 12:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=bF8Y+Yklveo4W0BkoIetYbVnsEr4yiOhda10mI6J5bU=; b=AyPDiOdTn9B7Hl67JfkcfXvrbTrcAn0yd8ADme4fSmHKrfLf3oMma1B+ezSEwV9N8x HcWjtZ6qI/u5l4cWZyiRaIeOYuCuRvFUOYuuXoPTpWbs/f95DCYdBRcEBmzy4L5DSssj KP+S0lZfoz8HVBMFj2IuK6Mg1t/ZwU6BhfOaZtjtPw7GdXCJBh74cm7jNdDzCc6/l6B1 oOSBHErajoii7b7oGy3DugBXJHmddVqC0IMsOqKdsiUgVlFnkezb9wzYV/V7jJFOK1ce Wdy6YgE+FtH4YxIgpZ08L2ct0a8mOSuldYwhBXoRYvmSRVrPEFT6pWpLzfnOPyIX0gMC GJtA== X-Received: by 10.180.73.134 with SMTP id l6mr11752273wiv.16.1380052230231; Tue, 24 Sep 2013 12:50:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.213.8 with HTTP; Tue, 24 Sep 2013 12:50:10 -0700 (PDT) From: Mike Kienenberger Date: Tue, 24 Sep 2013 15:50:10 -0400 Message-ID: Subject: No longer execute sql for relationships during optimistic locking which are not used for locking? To: dev@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org The third case where I use DataContextDelegate which I mentioned earlier is new, due to a change in behavior between 1.1 and now (I think the change happened in 1.2). I could probably use a DataChannelFilter here too, or I could also use a custom ServerRuntime to fix this one, but I'm hoping that we can treat this change as a bug and fix it instead. As I mentioned before, I have a non-Mandatory one-to-one relationship between User and PotentialCustomer. User always exists, but some Users have a matching PotentialCustomer record. Before, if the user -> PotentialCustomer relationship wasn't referenced with user.getPotentialCustomer() or something similar, the "Select * from Potential_Customer where user.id = potential_customer.id" sql was never executed. Now this query is always executed due to that change in how optimistic locking setup works, but it doesn't seem necessary to do so. The Potential_customer table only exists in certain environments, so I set up willPerformQuery() to intercept RelationshipQueries between User and PotentialCustomer and always return empty results instead of executing the sql when run in environments where the table doesn't exist. I suppose another approach I could take would be to set up a separate data domain for this table and others like them now that the runtime is more flexible. In any case, I have a lot of potential workarounds if we don't fix the change in behavior.