Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 61526 invoked from network); 30 Jan 2006 12:01:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Jan 2006 12:01:26 -0000 Received: (qmail 10783 invoked by uid 500); 30 Jan 2006 12:00:50 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 10757 invoked by uid 500); 30 Jan 2006 12:00:50 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 10746 invoked by uid 99); 30 Jan 2006 12:00:50 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2006 04:00:50 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [213.183.171.161] (HELO dns1.dbh.de) (213.183.171.161) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2006 04:00:48 -0800 Received: by dns1.dbh.de (Postfix, from userid 1001) id 2A07BC5A4; Mon, 30 Jan 2006 13:00:25 +0100 (CET) Received: from exchange.dbh.de (exchange.dbh.de [172.22.22.26]) by dns1.dbh.de (Postfix) with ESMTP id 85C97BB8B for ; Mon, 30 Jan 2006 13:00:23 +0100 (CET) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: AW: AW: AW: Geronimo CMP update statements X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Mon, 30 Jan 2006 12:52:36 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: AW: AW: Geronimo CMP update statements Thread-Index: AcYkNiaxYmHRA5rHRqmvJjn82LI7HQBT2o0w From: "Ueberbach, Michael" To: X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on dns1.dbh.de X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-105.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, USER_IN_WHITELIST autolearn=ham version=3.0.4 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Matt, sorry for the delay, but I've just found your mail this morning (and all = the other ones following in the discussion). To answer your question: In our last projects we really made extensive use of CMP (and CMR), = although we know (in fact we had to learn it this way) that there can be = many problems with it(particularly concerning the performance of the = application). On the other hand there is a great advantage in delegating standard work = to the application server as far as there is no demand for special = treatments. To my understanding this is one benefit of using an app = server. I assume the way geronimo generates update statements can be understand = as similar to the idea of using static finders declared in the dd, so = there is one update statement for every entity bean and this will be = used for every situation where an entity has to be updated (in fact = there will be only one prepared statement looking at the JDBC driver). To my experience this (I mean the use of static finders) is not = realistic from the point of view of application development. If you have = a lot of different entities with many different attributes it seems = impossible to me to describe all ever wanted search strategies in form = of static finder methods. So some app servers (to my knowing JBoss and = BEA Weblogic) offer the possibility of using something like dynamic = queries inside CMP, that means defining the wanted SELECT statement at = runtime. In the same way I think the app server should be flexible = enough to react on different update requirements in generating suitable = statements. Im very interested in the oncoming steps geronimo will do concerning = this point. Regards Michael -----Urspr=FCngliche Nachricht----- Von: Matt Hogstrom [mailto:matt@hogstrom.org] Gesendet: Samstag, 28. Januar 2006 19:10 An: user@geronimo.apache.org Betreff: Re: AW: AW: Geronimo CMP update statements Michael, IMO the current SQL generation is not consistent with what I've seen in = other=20 AppServers. I don't have any specific data yet but I know for at least = DB2 the=20 DB2 developers I've talked to have not seen this particular pattern. As = a=20 consequence, I expect Oracle would probably have the same comment. As = it stands=20 right now I think we need to go back and invest some serious time = rewriting the=20 SyntaxGenerators to generate more efficient SQL (at least for DB2). One of the feedback items I've heard is that CMP is not that prevalent = in the=20 world in terms of adoption. I'd be curious to get your feedback on how = you use=20 CMPs and their ubiquity in your environment. Thanks Matt Ueberbach, Michael wrote: > Hello Matt, >=20 > yes, this works. Thanks for the hint. > I think geronimo sends a statement like this one to the database >=20 > UPDATE table SET col1 =3D CASE WHEN false THEN null ELSE col1 END, = col2 =3D CASE WHEN true THEN newValue ELSE col1 END, ... >=20 > and Oracle does not know how to handle the boolean values true and = false, so they have to be replaced by some expressions like 1=3D1 or = 1=3D0. (This way I can reproduce the situation) >=20 > Nevertheless I think this behaviour should be modified not only for = the reason of wrongly fired triggers but also to reduce the = transportation load. >=20 > regards > Michael >=20 >=20 >=20 > -----Urspr=FCngliche Nachricht----- > Von: Matt Hogstrom [mailto:matt@hogstrom.org] > Gesendet: Donnerstag, 26. Januar 2006 17:22 > An: user@geronimo.apache.org > Betreff: Re: AW: Geronimo CMP update statements >=20 >=20 > Michael, >=20 > Add the following lines in your plan: >=20 > >=20 > These go after the cmp-connection factory. Let me know if this fixes = the problem. >=20 > Ueberbach, Michael wrote: >=20 >>Hello, >> >>I think there is another problem concerning this issue. >>Using an Oracle database (9i) I get this error when updating a cmr- = field: >> >>(...) >>Caused by: org.tranql.ql.QueryException: Error executing statement: = UPDATE konto SET erzeugt =3D CASE WHEN ? THEN ? ELSE erzeugt END, = bankname =3D CASE WHEN ? THEN ? ELSE bankname END, bankleitzahl =3D CASE = WHEN ? THEN ? ELSE bankleitzahl END, kontonummer =3D CASE WHEN ? THEN ? = ELSE kontonummer END, kontostand =3D CASE WHEN ? THEN ? ELSE kontostand = END, fk_person =3D CASE WHEN ? THEN ? ELSE fk_person END WHERE guid =3D = ? >>(...) >>Caused by: java.sql.SQLException: ORA-00920: invalid relational = operator=20 >> >>This not the case when using MySQL. >> >>regards >>Michael >> >> >>-----Urspr=FCngliche Nachricht----- >>Von: Gianny Damour [mailto:gianny.damour@optusnet.com.au] >>Gesendet: Donnerstag, 26. Januar 2006 13:16 >>An: user@geronimo.apache.org >>Betreff: Re: Geronimo CMP update statements >> >> >>Hi Dan, >> >>At the beginning, I was not seeing this as an issue. Based on your=20 >>remark that triggers are wrongly fired, I now see this as an issue = that=20 >>needs to be fixed. >> >>Could you please raise a JIRA for this problem? >> >>Thanks, >>Gianny >> >>Daniel John Debrunner wrote: >> >> >> >>>At ApacheConUS 2005 I talked with Matt Hogstrom about the SQL UPDATE >>>statements Geronimo was issuing against Derby for DayTrader. >>> >>>A single UPDATE statement is generated for a table that updates all >>>columns using a CASE statement to ensure un-modified columns are not >>>changed, or in reality changed to the same value. An example is >>>described in GERONIMO-1080, the syntax may be a little different for = Derby. >>> >>>http://issues.apache.org/jira/browse/GERONIMO-1080 >>> >>>I see two issues with this approach, one is that for Derby this is >>>inefficient, and two, and probably more important, all SQL update >>>triggers will fire due to this modification of all columns. Thus if = an >>>application defines a trigger on update of the address column of a >>>customer table, then when using Geronimo this trigger will fire, even = if >>>the CMP application is only updating the customer's balance. This = just >>>seems the wrong semantics to me. >>> >>>Matt had said this was a known issue, and that it was going to be = fixed. >>>The comments in GERONIMO-1080 seem to indicate that this may not be = seen >>>as an issue, though those comments are dated before ApacheCon. >>> >>>I searched Jira and couldn't see any bug for changing this, are there >>>any plans to address this? >>> >>>Thanks, >>>Dan. >>> >>> >>> >>> >>> >> >> >> >> >> >> >=20 >=20 >=20