More Oracle hijinks...

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

More Oracle hijinks...

Christopher J. Demers
I have been using Oracle via a DBConnection.  After doing some SQL
transformations I have it generally working with normal queries.  However if
I try to do something more advanced like getting the columns for a table it
seems to eventually return strange errors (Division by zero, Index out of
bounds in a ByteArray) and then Dolphin crashes.  I am using
DBConnection<<columns: to get the column details.  Sometimes it works a few
times, and then all hell breaks loose.  I am using version 9 drivers to talk
to a version 8 server.

I am really surprised that Oracle is so temperamental.  It doesn't seem very
robust at all.  Is anyone else using Oracle with the DBConnection?  Does
DBConnection<<columns: actually work consistently?

Chris


Reply | Threaded
Open this post in threaded view
|

Re: More Oracle hijinks...

John Brant
"Christopher J. Demers" <[hidden email]> wrote in
message news:bhrkqv$1oimj$[hidden email]...
> I have been using Oracle via a DBConnection.  After doing some SQL
> transformations I have it generally working with normal queries.  However
if
> I try to do something more advanced like getting the columns for a table
it
> seems to eventually return strange errors (Division by zero, Index out of
> bounds in a ByteArray) and then Dolphin crashes.  I am using
> DBConnection<<columns: to get the column details.  Sometimes it works a
few
> times, and then all hell breaks loose.  I am using version 9 drivers to
talk
> to a version 8 server.
>
> I am really surprised that Oracle is so temperamental.  It doesn't seem
very
> robust at all.  Is anyone else using Oracle with the DBConnection?  Does
> DBConnection<<columns: actually work consistently?

Have you tried the latest drivers? I had the same problem last year with
some 9i drivers. My problem was that Oracle was writing outside the bounds
of an integer column. Dolphin was giving it a 4 byte buffer, but Oracle was
writing a fifth byte which was 0. Of course, this corrupts Dolphin. Anyway,
I found some newer 9i drivers on Oracle's site that fixed the problem.


John Brant


Reply | Threaded
Open this post in threaded view
|

Re: More Oracle hijinks...

Dmitry Zamotkin-4
In reply to this post by Christopher J. Demers
Hello Christopher,

> I have been using Oracle via a DBConnection.  After doing some SQL
> transformations I have it generally working with normal queries.
> However if I try to do something more advanced like getting the
> columns for a table it seems to eventually return strange errors
> (Division by zero, Index out of bounds in a ByteArray) and then
> Dolphin crashes.  I am using DBConnection<<columns: to get the column
> details.  Sometimes it works a few times, and then all hell breaks
> loose.  I am using version 9 drivers to talk to a version 8 server.
>
> I am really surprised that Oracle is so temperamental.  It doesn't
> seem very robust at all.  Is anyone else using Oracle with the
> DBConnection?  Does DBConnection<<columns: actually work consistently?

I had same problem with DBConnection to Oracle after Dolphin 5
release. I have found a difference in
DBParameterizedStatement>>setParams method in 4 and 5 version of
Dolphin. I suppose that Oracle ODBC driver understands better
sqlSetParam() than sqlBindParameter(). After reverting old code I have
no problem with Oracle persistence.


------------
DBParameterizedStatement>>setParams
"Private - Bind parameter columns for a prepared SQL statement so that
when we
subsequently fill the buffer fields the statement is ready to exec.
Normally only done
just before first exec (from #parameters)."

| col field ret |
1 to: paramCols size do: [:i |
col := paramCols at: i.
field := parameters at: i.
ret := ODBCLibrary default
sqlSetParam: self allocatedHandle
ipar: i
fCType: SQL_C_DEFAULT
fSqlType: col type
cbColDef: col precision
ibScale: col scale
rgbValue: field fieldBuf
pcbValue: field lengthBuf.
self dbCheckException: ret ]
------------


--
Dmitry Zamotkin


Reply | Threaded
Open this post in threaded view
|

Re: More Oracle hijinks...

Christopher J. Demers
In reply to this post by John Brant
"John Brant" <[hidden email]> wrote in message
news:Ynf0b.149515$Oz4.40678@rwcrnsc54...
> "Christopher J. Demers" <[hidden email]> wrote in
> message news:bhrkqv$1oimj$[hidden email]...
..
> > I try to do something more advanced like getting the columns for a table
> it
> > seems to eventually return strange errors (Division by zero, Index out
of
> > bounds in a ByteArray) and then Dolphin crashes.  I am using
> > DBConnection<<columns: to get the column details.  Sometimes it works a
> few
> > times, and then all hell breaks loose.  I am using version 9 drivers to
> talk
> > to a version 8 server.
..
> Have you tried the latest drivers? I had the same problem last year with
> some 9i drivers. My problem was that Oracle was writing outside the bounds
> of an integer column. Dolphin was giving it a 4 byte buffer, but Oracle
was
> writing a fifth byte which was 0. Of course, this corrupts Dolphin.
Anyway,
> I found some newer 9i drivers on Oracle's site that fixed the problem.

Thank you, it seems the upgraded ODBC drivers have made things more stable.
I thought my drivers were fairly new (I only started working with Oracle a
few months ago), not new enough I guess.

Thanks,
Chris


Reply | Threaded
Open this post in threaded view
|

Re: More Oracle hijinks...

Christopher J. Demers
In reply to this post by Dmitry Zamotkin-4
"D.Zamotkin" <[hidden email]> wrote in message
news:[hidden email]...
> Hello Christopher,
> > I have been using Oracle via a DBConnection.  After doing some SQL
> > transformations I have it generally working with normal queries.
> > However if I try to do something more advanced like getting the
> > columns for a table it seems to eventually return strange errors
> > (Division by zero, Index out of bounds in a ByteArray) and then
> > Dolphin crashes.  I am using DBConnection<<columns: to get the column
> > details.  Sometimes it works a few times, and then all hell breaks
> > loose.  I am using version 9 drivers to talk to a version 8 server.
...
> I had same problem with DBConnection to Oracle after Dolphin 5
> release. I have found a difference in
> DBParameterizedStatement>>setParams method in 4 and 5 version of
> Dolphin. I suppose that Oracle ODBC driver understands better
> sqlSetParam() than sqlBindParameter(). After reverting old code I have
> no problem with Oracle persistence.
...

Actually I don't think I have hit that specific problem yet.  Though it is
certainly probable that I will, so thanks for he heads up.  I have had to
come up to speed on Oracle over the past few months.  I feel like I have
fallen out of a tree, and am hitting every branch on the way down.  To be
fair my situation may be more complex due to the need to interface with a 16
bit legacy application.  I just find having to maintain and work with Oracle
to be a pain.

Upgrading the ODBC driver solved my immediate problem.  Perhaps that would
also improve Oracle's ability to respond to the new Dolphin function.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: More Oracle hijinks...

Blair McGlashan
"Christopher J. Demers" <[hidden email]> wrote in
message news:bhu9q6$3a37d$[hidden email]...

> "D.Zamotkin" <[hidden email]> wrote in message
> news:[hidden email]...
> ...
> > I had same problem with DBConnection to Oracle after Dolphin 5
> > release. I have found a difference in
> > DBParameterizedStatement>>setParams method in 4 and 5 version of
> > Dolphin. I suppose that Oracle ODBC driver understands better
> > sqlSetParam() than sqlBindParameter(). After reverting old code I have
> > no problem with Oracle persistence.
> ...
>
> Upgrading the ODBC driver solved my immediate problem.  Perhaps that would
> also improve Oracle's ability to respond to the new Dolphin function.

Just to clarify: In Dolphin 5 we enhanced DBConnection to be compliant with
ODBC 3.0. SQLSetParam() was deprecated in favour of SQLBindParameter() in
ODBC 2.0. I would recommend trying the latest ODBC driver and only reverting
to the old code if absolutely necessary.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: More Oracle hijinks...

Dmitry Zamotkin-4
Hello Blair,

> Just to clarify: In Dolphin 5 we enhanced DBConnection to be compliant with
> ODBC 3.0. SQLSetParam() was deprecated in favour of SQLBindParameter() in
> ODBC 2.0. I would recommend trying the latest ODBC driver and only reverting
> to the old code if absolutely necessary.

And clarifying from me: we have about 30 remote connections to Oracle
via ODBC and we are to lazy to upgrade driver but we have auto upgrade
feature :)

I understand that SQLSetParam() was deprecated, but to continue
support old drivers we were downgrading code.