` Printed Icetips Article

Icetips Article



SQL Related Articles: Keep connection open until application terminates
2002-08-27 -- Michael Gould
 
Newsgroups: comp.lang.clarion


Fay,

If MS-SQL is like Sybase, it will open a cursor or connection after so many
prepare statements.

In Sybase there is are a couple of settings which will allow you to keep a
connection open and I would bet that MS-SQL has a similar type of parameter.

Look for options similar to...

SET OPTION PUBLIC.MAX_STATEMENT_COUNT=0;
SET OPTION PUBLIC.MAX_CURSOR_COUNT=0;

This basically sets the cursor and statement count governors off and keeps a
open
connection until the application exits.

HTH's

Michael Gould
Omni Computer Consulting, Inc.




"fay"  wrote in message
news:3d6a77bd$1@news.softvelocity.com...
> Using clarion c55ee ABC tempaltes and sql 2000/ sql7
>
>
> Our  application stores the main data in one database and images in
> different databases.  Normal scanning and viewing of images works ok.
But,
> I am writing a conversion to convert images from  and one of our older dos
> applications to our clarion application.  I make use of  code used in
noraml
> scanning to get the iamges into the imaing data bases.
>
> When running the conersion  it appear to be "eating" large amounts of
memogy
> and after successfully converting several thousnd images it bombs.  I
> isolated the problem code to be the code where  it is opening, closing and
> connecting to our image databases. To test.  I put just that code in a  a
> loop that I executed several thousands times.  The test code does nothing
> except, open, close and disocnnect form the imaging database.  It will
> execute several thousand iterations and then bomb with the following
> message:
>
> Connection failed
> SQL STATE '37000'
>
> SQL Server Error 552
> [Microsoft][ODBC SQL Serve Driver] {SQL Server} CYRPTOAPI function
> 'CryptAcquire Context' failed.  error  0X8009001d
> [Error description unavailable]
>
>
>
>
> I am testing with the server on my computer.  After geeting the error
> message I get an out of memory meesage if I try to do much of anything
else
> and  have to stop the server.
>
>
>
> Here is my test code:
>
>   lnct = 0
>  loop howmany times
>      glo:ImgConnect = 'DATABASE=' &CurrImgDB &';DRIVER=SQL SERVER'
> &';SERVER=' &TheSrvr &';UID=' &GLO:DSNUser &';PWD=' &GLO:DSNPassWord &';'
>   !!   trace('','glo:imgconnect = ' &glo:imgconnect)
>      OpenDB = CurrImgDB
>      open(imgs)
>      if error() then message('Error opening IMGS on write: ' &error() & '
> ' & fileerror()).
>
>      close(imgs)
>      if error() then message('Error closing IMGS on write: ' &error()).
>      imgs{prop:disconnect}
>      if error() then
>        message('error on disconnect: ' & fileerror())
>      end
>   end
>
>
>
> Can anyone tell me what I am doing wrong?
>
> Thanks, Fay
>
>
>



Printed December 4, 2024, 3:10 am
This article has been viewed/printed 35250 times.
Google search has resulted in 451 hits on this article since January 25, 2004.