FFI+ODBC Troubles

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

FFI+ODBC Troubles

vvm13xyz xyz
Please help me.
I am trying to switch from VisualWorks to Squeak but I can't connect to any my DB2 and Oracle databases.
 
I am using this files:
 
At first I tried old ODBC code from
and got "Could not coerce arguments" at my win32 (XP and Windows 2003 Server) computers. I can't understand this because all seems right. At SqueakDebug.log we can see
 
------------------------------------
Error: Could not coerce arguments
28 May 2009 4:18:23 pm

VM: Win32 - a SmalltalkImage
Image: Squeak3.10.2 [latest update: #7179]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir C:\squeak\1
Trusted Dir C:\squeak\1\vvm
Untrusted Dir C:\My Squeak\vvm

ODBCLibrary(Object)>>error:
    Receiver: an ODBCLibrary
    Arguments and temporary variables:
        aString:     'Could not coerce arguments'
    Receiver's instance variables:
        handle:     @ 16r4BF70000
        name:     'odbc32'

ODBCLibrary(Object)>>externalCallFailed
    Receiver: an ODBCLibrary
    Arguments and temporary variables:
        errCode:     6
    Receiver's instance variables:
        handle:     @ 16r4BF70000
        name:     'odbc32'

ODBCLibrary>>sqlBindCol:columnNumber:targetType:targetValue:bufferLength:strLength:
    Receiver: an ODBCLibrary
    Arguments and temporary variables:
        statementHandle:     a SQLHSTMT
        columnNumber:     1
        targetType:     1
        targetValue:     an ExternalData
        bufferLength:     8192
        strLenght:     a SQLInteger
    Receiver's instance variables:
        handle:     @ 16r4BF70000
        name:     'odbc32'

ODBCColumn>>bindBuffer
    Receiver: an ODBCColumn DUMMY (VarChar 1 nullable)
    Arguments and temporary variables:
------------------------------------
where
 
sqlBindCol: statementHandle columnNumber: columnNumber targetType: targetType targetValue: targetValue bufferLength: bufferLength strLength: strLenght
 "SQLRETURN 
 SQLGetData( 
 SQLHSTMT StatementHandle, 
 SQLUSMALLINT ColumnNumber,
 SQLSMALLINT TargetType, 
 SQLPOINTER TargetValue,
 SQLINTEGER BufferLength, 
 SQLINTEGER *StrLen_or_Ind);"
 <cdecl: short 'SQLBindCol' (SQLHSTMT ulong short void* long SQLInteger*)>
 ^ self externalCallFailed
 
I think all types are correct.
 
Also at Windows 2003 x64 I receive "Error:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [State:IM002]" for any datasource.
 
After that I am trying ODBC code from http://www.squeaksource.com/ODBC/ODBC-rjl.10.mcz
 
| con rs |
con _ ODBCConnection dsn:'somedsn' user:'somename' password:'somepwd'.
rs := con resultSetFor: 'SELECT ''xxx'' manana FROM dual'.
(con query: 'SELECT ''xxx'' manana FROM dual') results do:[:row | Transcript show: row; cr].
con close.
 
squeak image crashes somewhere near calling of "con resultSetFor:". No SqueakDebug.log generated in this case.  Crash.dmp contains:
------------------------------------
---------------------------------------------------------------------
Mon Jun 01 10:37:54 2009

Exception code: C0000005
Exception addr: 0040BD85
Access violation (read access) at 91233BDA
EAX:91233BDA    EBX:96A4E35C    ECX:00000003    EDX:96A4E35F
ESI:11233B78    EDI:91233BDB    EBP:0000138C    ESP:0006F998
EIP:0040BD85    EFL:00010286
FP Control: FFFF027F
FP Status:  FFFF5061
FP Tag:     FFFFFFFF

Hardware information:
    Manufacturer: Unknown
    Model: Unknown
    Number of processors: 1
    Page size: 4096

Memory Information (upon launch):
    Physical Memory Size: 2097151 kbytes
    Physical Memory Free: 1681472 kbytes
    Page File Size: 4194303 kbytes
    Page File Free: 4194303 kbytes
    Virtual Memory Size: 2097151 kbytes
    Virtual Memory Free: 2064020 kbytes
    Memory Load: 40 percent

Processor 0: AMD Athlon(tm) 64 Processor 3400+
    Identifier: x86 Family 15 Model 12 Stepping 0
    ~MHZ: 2411

Operating System: Microsoft Windows Server 2003 (Build 3790 Service Pack 1)
    Registered Owner: unnamed user
    Registered Company: unknown organization
    SP major version: 1
    SP minor version: 0
    Suite mask: 110
    Product type: 3

Display Information:
    Graphics adapter name: NVIDIA GeForce4 Ti 4200
    Primary monitor resolution: 1024 x 768

Device: NVIDIA GeForce4 Ti 4200
    Adapter String: GeForce4 Ti 4200
    Bios String: Version 4.25.00.29.00
    Chip Type: GeForce4 Ti 4200
    DAC Type: Integrated RAMDAC
    Memory Size: 0x04000000

Driver Versions:
    nv4_disp: 6.14.10.9371

VM Version: Squeak 3.10.6 (release) from Aug 30 2007
Compiler: gcc 2.95.2 19991024 (release)

Current byte code: 200
Primitive index: 264

Loaded plugins:
    odbc32
    SqueakFFIPrims 1 February 2007 (e)
    LargeIntegers v1.5 1 February 2007 (i)
    Matrix2x3Plugin 1 February 2007 (i)
    FloatArrayPlugin 1 February 2007 (i)
    BitBltPlugin 1 February 2007 (i)
    B2DPlugin 1 February 2007 (i)
    SecurityPlugin 1 February 2007 (i)
    FilePlugin 1 February 2007 (i)
    MiscPrimitivePlugin 1 February 2007 (i)


Stack dump:
------------------------------------

(Sorry for my English)
Victor


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: FFI+ODBC Troubles

vvm13xyz xyz
As I can see ODBC works when I load FFI via Universe Browser. Another methods like executing of
 is a failure (with crashed VM or coerce errors).


On Mon, Jun 1, 2009 at 10:53 AM, Victor Metelitsa <[hidden email]> wrote:
Please help me.
I am trying to switch from VisualWorks to Squeak but I can't connect to any my DB2 and Oracle databases.
 
I am using this files:
 
At first I tried old ODBC code from
and got "Could not coerce arguments" at my win32 (XP and Windows 2003 Server) computers. I can't understand this because all seems right. At SqueakDebug.log we can see
 
------------------------------------
Error: Could not coerce arguments
28 May 2009 4:18:23 pm

VM: Win32 - a SmalltalkImage
Image: Squeak3.10.2 [latest update: #7179]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir C:\squeak\1
Trusted Dir C:\squeak\1\vvm
Untrusted Dir C:\My Squeak\vvm

ODBCLibrary(Object)>>error:
    Receiver: an ODBCLibrary
    Arguments and temporary variables:
        aString:     'Could not coerce arguments'
    Receiver's instance variables:
        handle:     @ 16r4BF70000
        name:     'odbc32'

ODBCLibrary(Object)>>externalCallFailed
    Receiver: an ODBCLibrary
    Arguments and temporary variables:
        errCode:     6
    Receiver's instance variables:
        handle:     @ 16r4BF70000
        name:     'odbc32'

ODBCLibrary>>sqlBindCol:columnNumber:targetType:targetValue:bufferLength:strLength:
    Receiver: an ODBCLibrary
    Arguments and temporary variables:
        statementHandle:     a SQLHSTMT
        columnNumber:     1
        targetType:     1
        targetValue:     an ExternalData
        bufferLength:     8192
        strLenght:     a SQLInteger
    Receiver's instance variables:
        handle:     @ 16r4BF70000
        name:     'odbc32'

ODBCColumn>>bindBuffer
    Receiver: an ODBCColumn DUMMY (VarChar 1 nullable)
    Arguments and temporary variables:
------------------------------------
where
 
sqlBindCol: statementHandle columnNumber: columnNumber targetType: targetType targetValue: targetValue bufferLength: bufferLength strLength: strLenght
 "SQLRETURN 
 SQLGetData( 
 SQLHSTMT StatementHandle, 
 SQLUSMALLINT ColumnNumber,
 SQLSMALLINT TargetType, 
 SQLPOINTER TargetValue,
 SQLINTEGER BufferLength, 
 SQLINTEGER *StrLen_or_Ind);"
 <cdecl: short 'SQLBindCol' (SQLHSTMT ulong short void* long SQLInteger*)>
 ^ self externalCallFailed
 
I think all types are correct.
 
Also at Windows 2003 x64 I receive "Error:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [State:IM002]" for any datasource.
 
After that I am trying ODBC code from http://www.squeaksource.com/ODBC/ODBC-rjl.10.mcz
 
| con rs |
con _ ODBCConnection dsn:'somedsn' user:'somename' password:'somepwd'.
rs := con resultSetFor: 'SELECT ''xxx'' manana FROM dual'.
(con query: 'SELECT ''xxx'' manana FROM dual') results do:[:row | Transcript show: row; cr].
con close.
 
squeak image crashes somewhere near calling of "con resultSetFor:". No SqueakDebug.log generated in this case.  Crash.dmp contains:
------------------------------------
---------------------------------------------------------------------
Mon Jun 01 10:37:54 2009

Exception code: C0000005
Exception addr: 0040BD85
Access violation (read access) at 91233BDA
EAX:91233BDA    EBX:96A4E35C    ECX:00000003    EDX:96A4E35F
ESI:11233B78    EDI:91233BDB    EBP:0000138C    ESP:0006F998
EIP:0040BD85    EFL:00010286
FP Control: FFFF027F
FP Status:  FFFF5061
FP Tag:     FFFFFFFF

Hardware information:
    Manufacturer: Unknown
    Model: Unknown
    Number of processors: 1
    Page size: 4096

Memory Information (upon launch):
    Physical Memory Size: 2097151 kbytes
    Physical Memory Free: 1681472 kbytes
    Page File Size: 4194303 kbytes
    Page File Free: 4194303 kbytes
    Virtual Memory Size: 2097151 kbytes
    Virtual Memory Free: 2064020 kbytes
    Memory Load: 40 percent

Processor 0: AMD Athlon(tm) 64 Processor 3400+
    Identifier: x86 Family 15 Model 12 Stepping 0
    ~MHZ: 2411

Operating System: Microsoft Windows Server 2003 (Build 3790 Service Pack 1)
    Registered Owner: unnamed user
    Registered Company: unknown organization
    SP major version: 1
    SP minor version: 0
    Suite mask: 110
    Product type: 3

Display Information:
    Graphics adapter name: NVIDIA GeForce4 Ti 4200
    Primary monitor resolution: 1024 x 768

Device: NVIDIA GeForce4 Ti 4200
    Adapter String: GeForce4 Ti 4200
    Bios String: Version 4.25.00.29.00
    Chip Type: GeForce4 Ti 4200
    DAC Type: Integrated RAMDAC
    Memory Size: 0x04000000

Driver Versions:
    nv4_disp: 6.14.10.9371

VM Version: Squeak 3.10.6 (release) from Aug 30 2007
Compiler: gcc 2.95.2 19991024 (release)

Current byte code: 200
Primitive index: 264

Loaded plugins:
    odbc32
    SqueakFFIPrims 1 February 2007 (e)
    LargeIntegers v1.5 1 February 2007 (i)
    Matrix2x3Plugin 1 February 2007 (i)
    FloatArrayPlugin 1 February 2007 (i)
    BitBltPlugin 1 February 2007 (i)
    B2DPlugin 1 February 2007 (i)
    SecurityPlugin 1 February 2007 (i)
    FilePlugin 1 February 2007 (i)
    MiscPrimitivePlugin 1 February 2007 (i)


Stack dump:
------------------------------------

(Sorry for my English)
Victor



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners