Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 46878 invoked from network); 6 Apr 2006 12:02:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2006 12:02:35 -0000 Received: (qmail 35162 invoked by uid 500); 6 Apr 2006 12:02:33 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 35139 invoked by uid 500); 6 Apr 2006 12:02:32 -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 35128 invoked by uid 99); 6 Apr 2006 12:02:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 05:02:32 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of olivier.voutat@gmail.com designates 64.233.162.199 as permitted sender) Received: from [64.233.162.199] (HELO zproxy.gmail.com) (64.233.162.199) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 05:02:31 -0700 Received: by zproxy.gmail.com with SMTP id 13so104684nzn for ; Thu, 06 Apr 2006 05:02:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=BeZjcOX9d23YEmdPb0vMZc36pl72Oo/de7sQlBzT4E2MQbbD+Ena5HQDxjkIokKGISF5jB9LaeJAZ+NyOmysYjFA61XunA8UJGHaVeniM/hojwNfimnlifoTbZ7Dl8ByqdvMHoZN6uDS0WAjUznxVP550eqc2giop3t1HhELREE= Received: by 10.65.196.7 with SMTP id y7mr468421qbp; Thu, 06 Apr 2006 05:02:10 -0700 (PDT) Received: by 10.64.220.20 with HTTP; Thu, 6 Apr 2006 05:02:10 -0700 (PDT) Message-ID: <124d285e0604060502iba45aecyf4ce0b3dd935da1b@mail.gmail.com> Date: Thu, 6 Apr 2006 09:02:10 -0300 From: "Olivier Voutat" To: user@geronimo.apache.org Subject: Re: FindByPrimaryKey In-Reply-To: <4434EA72.6090509@optusnet.com.au> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_22033_1223280.1144324930821" References: <124d285e0604040900l619c7ce3vfe5af283ce5a6066@mail.gmail.com> <74e15baa0604040923re04e43ap71f568eb88a06d0c@mail.gmail.com> <124d285e0604042001v1126c1a9m3c45037349e61fb6@mail.gmail.com> <74e15baa0604042009q564d37du9453464b4b81e0a2@mail.gmail.com> <124d285e0604042033n1ba77ceck8ebf19a33da63ee8@mail.gmail.com> <74e15baa0604042132o33c28a52v50e97f5edddc5531@mail.gmail.com> <124d285e0604050241g19783e7cq243df5981da8b4b3@mail.gmail.com> <4433C491.9080704@optusnet.com.au> <44340596.1070809@hogstrom.org> <4434EA72.6090509@optusnet.com.au> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_22033_1223280.1144324930821 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Which version is like that ? It is not a official release yet, is it ? Best Regards, Olivier Voutat On 4/6/06, Gianny Damour wrote: > > Hi Matt, > > In trunk, we already have the individual update statement strategy > turned on by default. If you want to switch back to the universal update > command, i.e the "CASE THEN" approach, then you can flag an entity with > the static-sql element. > > So, I think that we are ok. > > Thanks, > Gianny > > Matt Hogstrom wrote: > > > Gianny, > > > > I think we should consider changing the default behaviour for "SET > > =3D CASE WHEN ? THEN ? > > > ELSE ". DB2 doesn't like it, Oracle doesn't like it, Derby > > doesn't like it and Firebird apparently doesn't like it :) > > > > I think I'd be in favor of a universal update command that updates all > > columns regardless if they have changed or individual update > > statements for only the columns that have changed. > > > > What are your thoughts? > > > > Matt > > > > Gianny Damour wrote: > > > >> Hi Olivier, > >> > >> I think that Firebird does not like the generated UPDATE statements. > >> More accurately it does not like the "SET =3D CASE WHEN ? THE= N > >> ? ELSE " syntax. > >> > >> This problem has been fixed in head as the UPDATE statements will > >> only use the "SET =3D ?" syntax. Meanwhile, do you know what > >> the Firebird syntax is to achieve the same result than "SET > >> =3D CASE WHEN ? THEN ? ELSE ". If you give us this syntax, I > >> think that it should be quick easy to fix this problem (basically, we > >> can implement a DBSyntaxFactory and enable it by setting the > >> db-syntax-factory element of the openejb-jar DD). > >> > >> Thanks, > >> Gianny > >> > >> Olivier Voutat wrote: > >> > >>> Lol, there is no space, it is just the Ctrl-c Ctrl-v, cause there > >>> was no space in my writing e-mail window so it did a return line. > >>> > >>> Anyway, maybe it is a tip of which is the problem, but I tried to > >>> use my findBySituation, and it works BUT I don't get to alter the > >>> LocalCar (s) returned. > >>> > >>> My code in my SessionBean > >> > >> > >> > >> > >> > >>> > >>> 00:34:32,073 WARN [GeronimoConnectionEventListener] > >>> connectionErrorOccurred called with null > >>> org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. > >>> Dynamic SQL Error > >>> SQL error code =3D -104 > >>> Token unknown - line 1, char 39 > >>> THEN > >>> at > >>> org.firebirdsql.jdbc.AbstractPreparedStatement.( > AbstractPreparedStatement.java:118) > >>> > >>> at org.firebirdsql.jdbc.FBPreparedStatement > >>> .(FBPreparedStatement.java:40) > >> > >> > >> > >> > >> > >>> Caused by: org.tranql.ql.QueryException: Error executing statement: > >>> UPDATE CARROS SET MARCA =3D CASE WHEN ? THEN ? ELSE MARCA END, MODELO > >>> =3D CASE WHEN ? THEN ? ELSE MODELO END, PLACA =3D CASE WHEN ? THEN ? > >>> ELSE PLACA END, QUILOMETRAGEM =3D CASE WHEN ? THEN ? ELSE > >>> QUILOMETRAGEM END, COR =3D CASE WHEN ? THEN ? ELSE COR END, SITUACAO = =3D > >>> CASE WHEN ? THEN ? ELSE SITUACAO END, TIPO =3D CASE WHEN ? THEN ? ELS= E > >>> TIPO END, DIARIA =3D CASE WHEN ? THEN ? ELSE DIARIA END WHERE CHASSI = =3D ? > >>> at > >>> org.tranql.sql.jdbc.JDBCUpdateCommand.execute(JDBCUpdateCommand.java > :69) > >>> > >>> at > >>> org.tranql.cache.SimpleFlushStrategy.flush(SimpleFlushStrategy.java > :64) > >>> at org.tranql.cache.SimpleFlushStrategy.flush > >>> (SimpleFlushStrategy.java:49) > >>> at > >>> org.tranql.cache.cache.InTxCacheTracker.flush(InTxCacheTracker.java > :41) > >>> at org.tranql.cache.InTxCache.flush(InTxCache.java:86) > >>> at > >>> > org.apache.geronimo.transaction.context.AbstractTransactionContext.flushS= tate > >>> (AbstractTransactionContext.java:115) > >>> at > >>> > org.apache.geronimo.transaction.context.InheritableTransactionContext.com= plete > (InheritableTransactionContext.java:175) > >>> > >>> ... 24 more > >>> Caused by: org.firebirdsql.jdbc.FBSQLExcep tion : GDS Exception. > >>> 335544569. Dynamic SQL Error > >>> SQL error code =3D -104 > >>> Token unknown - line 1, char 39 > >>> THEN > >>> at > >>> org.firebirdsql.jdbc.AbstractPreparedStatement.( > AbstractPreparedStatement.java:118) > >>> > >> > >> > >> > >> > >> > >> > >> > >> > > > > > > > -- Olivier Jeanpierre Voutat Rua Praia de Muri=FA, 9188 Cep 59092-390 / Natal - RN Tel: (84) 3219-0427 Cel: (84) 9977-3917 ------=_Part_22033_1223280.1144324930821 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Which version is like that ? It is not a official release yet, is it ?

Best Regards,
Olivier Voutat

On 4/6/06, Gianny Damour <gianny.damour@optusnet.com.au> wrote: Hi Matt,

In trunk, we already have the individual update statement s= trategy
turned on by default. If you want to switch back to the universa= l update
command, i.e the "CASE THEN" approach, then you can f= lag an entity with
the static-sql element.

So, I think that we are ok.

Thank= s,
Gianny

Matt Hogstrom wrote:

> Gianny,
>
>= ; I think we should consider changing the default behaviour for "SET
> <column> =3D CASE WHEN ? THEN ?
> > ELSE <column= >".  DB2 doesn't like it, Oracle doesn't like it, Derby> doesn't like it and Firebird apparently doesn't like it :)
>> I think I'd be in favor of a universal update command that updates a= ll
> columns regardless if they have changed or individual update
&g= t; statements for only the columns that have changed.
>
> What = are your thoughts?
>
> Matt
>
> Gianny Damour wrote= :
>
>> Hi Olivier,
>>
>> I think that Fireb= ird does not like the generated UPDATE statements.
>> More accurat= ely it does not like the "SET <column> =3D CASE WHEN ? THEN
>> ? ELSE <column>" syntax.
>>
>> This p= roblem has been fixed in head as the UPDATE statements will
>> onl= y use the "SET <column> =3D ?" syntax. Meanwhile, do you kn= ow what
>> the Firebird syntax is to achieve the same result than "S= ET <column>
>> =3D CASE WHEN ? THEN ? ELSE <column>&qu= ot;. If you give us this syntax, I
>> think that it should be quic= k easy to fix this problem (basically, we
>> can implement a DBSyntaxFactory and enable it by setting the>> db-syntax-factory element of the openejb-jar DD).
>>>> Thanks,
>> Gianny
>>
>> Olivier Voutat= wrote:
>>
>>> Lol, there is no space, it is just the Ctrl-c = Ctrl-v, cause there
>>> was no space in my writing e-mail windo= w so it did a return line.
>>>
>>> Anyway, maybe it= is a tip of which is the problem, but I tried to
>>> use my findBySituation, and it works BUT I don't get to al= ter the
>>> LocalCar (s)  returned.
>>>>>> My code in my SessionBean
>>
>>
>>= ;
>> <snip>
>>
>>>
>>> 00:34:32,073 WARN  [= GeronimoConnectionEventListener]
>>> connectionErrorOccurred ca= lled with null
>>> org.firebirdsql.jdbc.FBSQLException: GDS Exc= eption. 335544569.
>>> Dynamic SQL Error
>>> SQL error code =3D -104<= br>>>> Token unknown - line 1, char 39
>>> THEN
>= ;>>         at
>>>= ; org.firebirdsql.jdbc.AbstractPreparedStatement .<init>(AbstractPreparedStatement.java:118)
>>>
>&g= t;>         at org.firebirdsql.j= dbc.FBPreparedStatement
>>> .<init>(FBPreparedStatement.j= ava:40)
>>
>>
>>
>> <snip>
>>
>>> Caused by: org.tranql= .ql.QueryException: Error executing statement:
>>> UPDATE CARRO= S SET MARCA =3D CASE WHEN ? THEN ? ELSE MARCA END, MODELO
>>> = =3D CASE WHEN ? THEN ? ELSE MODELO END, PLACA =3D CASE WHEN ? THEN ?
>>> ELSE PLACA END, QUILOMETRAGEM =3D CASE WHEN ? THEN ? ELSE<= br>>>> QUILOMETRAGEM END, COR =3D CASE WHEN ? THEN ? ELSE COR END,= SITUACAO =3D
>>> CASE WHEN ? THEN ? ELSE SITUACAO END, TIPO = =3D CASE WHEN ? THEN ? ELSE
>>> TIPO END, DIARIA =3D CASE WHEN ? THEN ? ELSE DIARIA END WH= ERE CHASSI =3D ?
>>>       &= nbsp; at
>>> org.tranql.sql.jdbc.JDBCUpdateCommand.execute(JDBC= UpdateCommand.java:69)
>>>
>>>         at
>>= > org.tranql.cache.SimpleFlushStrategy.flush(SimpleFlushStrategy.java:64= )
>>>         at org.tr= anql.cache.SimpleFlushStrategy.flush
>>> (SimpleFlushStrategy.j= ava :49)
>>>         at
= >>> org.tranql.cache.cache.InTxCacheTracker.flush(InTxCacheTracker= .java:41)
>>>         a= t org.tranql.cache.InTxCache.flush(InTxCache.java:86)
>>> =         at
>>> org.apache.geronimo.transaction.context.AbstractTransactio= nContext.flushState
>>> (AbstractTransactionContext.java:115)>>>         at
>&g= t;> org.apache.geronimo.transaction.context.InheritableTransactionContex= t.complete (InheritableTransactionContext.java:175)
>>>
>>>&nb= sp;        ... 24 more
>>> C= aused by: org.firebirdsql.jdbc.FBSQLExcep tion : GDS Exception.
>>= > 335544569. Dynamic SQL Error
>>> SQL error code =3D -104
>>> Token unknown - line 1= , char 39
>>> THEN
>>>     = ;    at
>>> org.firebirdsql.jdbc.AbstractPrepare= dStatement.<init>(AbstractPreparedStatement.java :118)
>>>
>>
>>
>>
>>
&g= t;>
>>
>>
>>
>
>





--
Olivier Jeanpierre Voutat Rua Praia de Muri=FA, 9188
Cep 59092-390 / Natal - RN
Tel: (84) 3219-= 0427 Cel: (84) 9977-3917 ------=_Part_22033_1223280.1144324930821--