ODBC incompatibility?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ODBC incompatibility?

Bèrto ëd Sèra
Hi!

I observed something funny. To use ODBC for squeak I first need to file in the FFI package (otherwise I miss the ExternalEntity class). But this seems to break swazoo, which becomes irresponsive. On restarting the image it says that Timestamp does not understand a number of methods. I can't seem to find the point in FFI and/or ODBC that redefine anything in Timestamp, though. I surely find a new:

Magnitude subclass: #TimeStamp
    instanceVariableNames: 'date time'
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Kernel-Magnitudes'


The broken method on SPTimestamp is
===================================
asRFC1123StringOn: targetStream
    "^self
    Code taken from Swazoo Timestamp extenton with the following comment: FIXME: Assumes
    server's clock is GMT. Should convert server's clock to GMT if it is not. Besides that,
    this whole method is really ugly."
    targetStream nextPutAll: (self underlyingTimestamp asDate weekday copyFrom: 1 to: 3);
        nextPutAll: ', '.
    self underlyingTimestamp day < 10 ifTrue: [targetStream nextPut: $0].
    self underlyingTimestamp asDate printOn: targetStream format: #(1 2 3 $  2 1).   
    targetStream space.
    self underlyingTimestamp printHMSOn: targetStream.
    targetStream nextPutAll: ' GMT'
===================================

Now, how can this happen? The two classes have different names, don't they? In my visualworks days I cannot remember any such incident. Can anyone give me a hint?

To repeat the bug:
1) Get a fresh once-click image
2) install FFI
3) install ODBC for Squeak

Thanks
Berto

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: ODBC incompatibility?

Janko Mivšek
Hi Bèrto,

This is really funny. Swazoo strictly uses Sport's SpTimestamp and not
any of Squeak versions of Timestamp, so I can't see how ODBC code can
override something by accident.

Have someone a bit time to reproduce and investigate this case?

Janko

Bèrto ëd Sèra wrote:

> Hi!
>
> I observed something funny. To use ODBC for squeak I first need to file
> in the FFI package (otherwise I miss the ExternalEntity class). But this
> seems to break swazoo, which becomes irresponsive. On restarting the
> image it says that Timestamp does not understand a number of methods. I
> can't seem to find the point in FFI and/or ODBC that redefine anything
> in Timestamp, though. I surely find a new:
>
> Magnitude subclass: #TimeStamp
>     instanceVariableNames: 'date time'
>     classVariableNames: ''
>     poolDictionaries: ''
>     category: 'Kernel-Magnitudes'
>
>
> The broken method on SPTimestamp is
> ===================================
> asRFC1123StringOn: targetStream
>     "^self
>     Code taken from Swazoo Timestamp extenton with the following
> comment: FIXME: Assumes
>     server's clock is GMT. Should convert server's clock to GMT if it is
> not. Besides that,
>     this whole method is really ugly."
>     targetStream nextPutAll: (self underlyingTimestamp asDate weekday
> copyFrom: 1 to: 3);
>         nextPutAll: ', '.
>     self underlyingTimestamp *day* < 10 ifTrue: [targetStream nextPut: $0].
>     self underlyingTimestamp asDate printOn: targetStream format: #(1 2
> 3 $  2 1).  
>     targetStream space.
>     self underlyingTimestamp *printHMSOn:* targetStream.
>     targetStream nextPutAll: ' GMT'
> ===================================
>
> Now, how can this happen? The two classes have different names, don't
> they? In my visualworks days I cannot remember any such incident. Can
> anyone give me a hint?
>
> To repeat the bug:
> 1) Get a fresh once-click image
> 2) install FFI
> 3) install ODBC for Squeak
>
> Thanks
> Berto
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: ODBC incompatibility?

Bèrto ëd Sèra
FYI

something weird really happens: if you search in the image for the class Timestamp you get 5 matches:
TimeStamp
SQLTimestamp
SPTimestamp
TimeStamp
TimeStampTest

the 1st and the 4th both will get you the to Magnitude subclass. It looks as if something badly puzzled the image.
Berto


2008/10/17 Janko Mivšek <[hidden email]>
Hi Bèrto,

This is really funny. Swazoo strictly uses Sport's SpTimestamp and not
any of Squeak versions of Timestamp, so I can't see how ODBC code can
override something by accident.

Have someone a bit time to reproduce and investigate this case?

Janko

Bèrto ëd Sèra wrote:
> Hi!
>
> I observed something funny. To use ODBC for squeak I first need to file
> in the FFI package (otherwise I miss the ExternalEntity class). But this
> seems to break swazoo, which becomes irresponsive. On restarting the
> image it says that Timestamp does not understand a number of methods. I
> can't seem to find the point in FFI and/or ODBC that redefine anything
> in Timestamp, though. I surely find a new:
>
> Magnitude subclass: #TimeStamp
>     instanceVariableNames: 'date time'
>     classVariableNames: ''
>     poolDictionaries: ''
>     category: 'Kernel-Magnitudes'
>
>
> The broken method on SPTimestamp is
> ===================================
> asRFC1123StringOn: targetStream
>     "^self
>     Code taken from Swazoo Timestamp extenton with the following
> comment: FIXME: Assumes
>     server's clock is GMT. Should convert server's clock to GMT if it is
> not. Besides that,
>     this whole method is really ugly."
>     targetStream nextPutAll: (self underlyingTimestamp asDate weekday
> copyFrom: 1 to: 3);
>         nextPutAll: ', '.
>     self underlyingTimestamp *day* < 10 ifTrue: [targetStream nextPut: $0].
>     self underlyingTimestamp asDate printOn: targetStream format: #(1 2
> 3 $  2 1).
>     targetStream space.
>     self underlyingTimestamp *printHMSOn:* targetStream.
>     targetStream nextPutAll: ' GMT'
> ===================================
>
> Now, how can this happen? The two classes have different names, don't
> they? In my visualworks days I cannot remember any such incident. Can
> anyone give me a hint?
>
> To repeat the bug:
> 1) Get a fresh once-click image
> 2) install FFI
> 3) install ODBC for Squeak
>
> Thanks
> Berto
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: ODBC incompatibility?

Rob Rothwell
Hello all...try this ODBC changeset, which works with Swazoo...

Sorry about the delay; I was at a conference without internet all last week!

I don't remember how I fixed it many many months ago; but it had something to do with the constants that get loaded in the change set.

Hope this helps...

Rob

On Fri, Oct 17, 2008 at 5:46 AM, Bèrto ëd Sèra <[hidden email]> wrote:
FYI

something weird really happens: if you search in the image for the class Timestamp you get 5 matches:
TimeStamp
SQLTimestamp
SPTimestamp
TimeStamp
TimeStampTest

the 1st and the 4th both will get you the to Magnitude subclass. It looks as if something badly puzzled the image.
Berto


2008/10/17 Janko Mivšek <[hidden email]>

Hi Bèrto,

This is really funny. Swazoo strictly uses Sport's SpTimestamp and not
any of Squeak versions of Timestamp, so I can't see how ODBC code can
override something by accident.

Have someone a bit time to reproduce and investigate this case?

Janko

Bèrto ëd Sèra wrote:
> Hi!
>
> I observed something funny. To use ODBC for squeak I first need to file
> in the FFI package (otherwise I miss the ExternalEntity class). But this
> seems to break swazoo, which becomes irresponsive. On restarting the
> image it says that Timestamp does not understand a number of methods. I
> can't seem to find the point in FFI and/or ODBC that redefine anything
> in Timestamp, though. I surely find a new:
>
> Magnitude subclass: #TimeStamp
>     instanceVariableNames: 'date time'
>     classVariableNames: ''
>     poolDictionaries: ''
>     category: 'Kernel-Magnitudes'
>
>
> The broken method on SPTimestamp is
> ===================================
> asRFC1123StringOn: targetStream
>     "^self
>     Code taken from Swazoo Timestamp extenton with the following
> comment: FIXME: Assumes
>     server's clock is GMT. Should convert server's clock to GMT if it is
> not. Besides that,
>     this whole method is really ugly."
>     targetStream nextPutAll: (self underlyingTimestamp asDate weekday
> copyFrom: 1 to: 3);
>         nextPutAll: ', '.
>     self underlyingTimestamp *day* < 10 ifTrue: [targetStream nextPut: $0].
>     self underlyingTimestamp asDate printOn: targetStream format: #(1 2
> 3 $  2 1).
>     targetStream space.
>     self underlyingTimestamp *printHMSOn:* targetStream.
>     targetStream nextPutAll: ' GMT'
> ===================================
>
> Now, how can this happen? The two classes have different names, don't
> they? In my visualworks days I cannot remember any such incident. Can
> anyone give me a hint?
>
> To repeat the bug:
> 1) Get a fresh once-click image
> 2) install FFI
> 3) install ODBC for Squeak
>
> Thanks
> Berto
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida



_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

ODBC-rjriv.1.cs (90K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ODBC incompatibility?

Janko Mivšek
Thanks Rob for the patch.

In few words, what change is needed in Swazoo (or Sport) to avoid this
ODBC problem without any patching? Maybe patching Sport or Swazoo will
be easier than changing the "official" ODBC package. Or no?

Janko


Rob Rothwell wrote:

> Hello all...try this ODBC changeset, which works with Swazoo...
>
> Sorry about the delay; I was at a conference without internet all last week!
>
> I don't remember how I fixed it many many months ago; but it had
> something to do with the constants that get loaded in the change set.
>
> Hope this helps...
>
> Rob
>
> On Fri, Oct 17, 2008 at 5:46 AM, Bèrto ëd Sèra <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     FYI
>
>     something weird really happens: if you search in the image for the
>     class Timestamp you get 5 matches:
>     TimeStamp
>     SQLTimestamp
>     SPTimestamp
>     TimeStamp
>     TimeStampTest
>
>     the 1st and the 4th both will get you the to Magnitude subclass. It
>     looks as if something badly puzzled the image.
>     Berto
>
>
>     2008/10/17 Janko Mivšek <[hidden email]
>     <mailto:[hidden email]>>
>
>         Hi Bèrto,
>
>         This is really funny. Swazoo strictly uses Sport's SpTimestamp
>         and not
>         any of Squeak versions of Timestamp, so I can't see how ODBC
>         code can
>         override something by accident.
>
>         Have someone a bit time to reproduce and investigate this case?
>
>         Janko
>
>         Bèrto ëd Sèra wrote:
>          > Hi!
>          >
>          > I observed something funny. To use ODBC for squeak I first
>         need to file
>          > in the FFI package (otherwise I miss the ExternalEntity
>         class). But this
>          > seems to break swazoo, which becomes irresponsive. On
>         restarting the
>          > image it says that Timestamp does not understand a number of
>         methods. I
>          > can't seem to find the point in FFI and/or ODBC that redefine
>         anything
>          > in Timestamp, though. I surely find a new:
>          >
>          > Magnitude subclass: #TimeStamp
>          >     instanceVariableNames: 'date time'
>          >     classVariableNames: ''
>          >     poolDictionaries: ''
>          >     category: 'Kernel-Magnitudes'
>          >
>          >
>          > The broken method on SPTimestamp is
>          > ===================================
>          > asRFC1123StringOn: targetStream
>          >     "^self
>          >     Code taken from Swazoo Timestamp extenton with the following
>          > comment: FIXME: Assumes
>          >     server's clock is GMT. Should convert server's clock to
>         GMT if it is
>          > not. Besides that,
>          >     this whole method is really ugly."
>          >     targetStream nextPutAll: (self underlyingTimestamp asDate
>         weekday
>          > copyFrom: 1 to: 3);
>          >         nextPutAll: ', '.
>          >     self underlyingTimestamp *day* < 10 ifTrue: [targetStream
>         nextPut: $0].
>          >     self underlyingTimestamp asDate printOn: targetStream
>         format: #(1 2
>          > 3 $  2 1).
>          >     targetStream space.
>          >     self underlyingTimestamp *printHMSOn:* targetStream.
>          >     targetStream nextPutAll: ' GMT'
>          > ===================================
>          >
>          > Now, how can this happen? The two classes have different
>         names, don't
>          > they? In my visualworks days I cannot remember any such
>         incident. Can
>          > anyone give me a hint?
>          >
>          > To repeat the bug:
>          > 1) Get a fresh once-click image
>          > 2) install FFI
>          > 3) install ODBC for Squeak
>          >
>          > Thanks
>          > Berto
>          >
>          >
>          >
>         ------------------------------------------------------------------------
>          >
>          > _______________________________________________
>          > Aida mailing list
>          > [hidden email] <mailto:[hidden email]>
>          > http://lists.aidaweb.si/mailman/listinfo/aida
>
>         --
>         Janko Mivšek
>         AIDA/Web
>         Smalltalk Web Application Server
>         http://www.aidaweb.si
>         _______________________________________________
>         Aida mailing list
>         [hidden email] <mailto:[hidden email]>
>         http://lists.aidaweb.si/mailman/listinfo/aida
>
>
>
>     _______________________________________________
>     Aida mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.aidaweb.si/mailman/listinfo/aida
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida