Re: handling db connection error

Tech-Archive recommends: Speed Up your PC by fixing your registry




Thanks
"Linchi Shea" <LinchiShea@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8D25BA9B-C2C1-4A6F-9E83-EBCB4F542077@xxxxxxxxxxxxxxxx
is there a way not to close the transaction when restore is being made?

When a database is in standby, you can't do anything with it. Why do you
want to keep any transaction open?

From your post, however it looks like you are talking about keeping the
connection open (instead of transaction), and it looks like you are trying
to
do this strictly in T-SQL. T-SQL is not the right language to handle
connections. In a T-SQL script, you assume there is already a connection
open
to run that script. To handle connections robustly, you need to use a
different language/tool.

If you want to stick to T-SQL, you could make it so that the script will
check for the status of a database before trying to use it, and use a job
scheduler such as SQL Agent to keep ret-trying the script if the script is
aborted when it has already started using a database.

But handling connections should really be done in a 'real'
programming/scripting language that is built to deal with connections.

Linchi

"Roy Goldhammer" wrote:

Hello there

I need to build a process which imports table from Standby database.

i can read data as long that restore is not occur.

when it occur the transaction is being closed, even if i set it with
Try..catch.

is there a way not to close the transaction when restore is being made?





.



Relevant Pages

  • Re: How to handle large number of users
    ... The client app will work on mobile phones using WinCE and it is just a small app updating some tables in the database on the server. ... use a Database Pooling mechanism, that controlled the number of active connections to the DB server through the pool. ... You are not going to be storing mountains of data, the streams will be small and the data capture should be relatively small (unless you are collecting transaction times, rates, etc). ... Lets assume that your transaction rate for inserting and/or updating the database for the 10K data stream is 100 milliseconds. ...
    (borland.public.delphi.non-technical)
  • statement not allowed within multi-statement transaction (Long)
    ... allowed within multi-statement transaction. ... I have a sample script that is available on request. ... database and then create different versions of the database to meet our ... Detaches the database and copies the upgraded mdf and ldf files to the ...
    (microsoft.public.sqlserver.programming)
  • Re: statement not allowed within multi-statement transaction (Long)
    ... The error is telling you that you are in transaction state, ... Wayne Snyder, MCDBA, SQL Server MVP ... > I have a sample script that is available on request. ... > database and then create different versions of the database to meet our ...
    (microsoft.public.sqlserver.programming)
  • Re: Warning: mysql_query(): 4 is not a valid MySQL-Link resource
    ... And database connection will be closed anyway when there are no other ... while another script might need it is not a good thing... ... connections to a database are usually limited. ... Connecting to the database has to have significant overhead (database server usuallly not the same as the server running the script). ...
    (comp.lang.php)
  • RE: handling db connection error
    ... When a database is in standby, you can't do anything with it. ... connection open (instead of transaction), and it looks like you are trying to ... In a T-SQL script, you assume there is already a connection open ... To handle connections robustly, ...
    (microsoft.public.sqlserver.programming)