How to close a connection to the database

Is there any way to close a connection to the database server with Jconnect?

I'm opening a connection from an application run through a cgi script on the
web. It seems that if there is some kind of problem at runtime, the
connections are kept open on the server.

In the documentation, I haven't found any instruction to do this.


Guibert Englebienne

7/31/1998 9:06:28 PM
sybase.jconnect30 552 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 40

Are you calling _con.close();

You can call this to disconnect.  Make sure if you are doing the connect as part
of the same try block as the query, you disconnect in a finally block.

Here's another  thing you may look at.  Have you network guys check the value of
TCP_KEEPALIVE in the OS.  ASE depends on the OS TCP stack.  Many OS's by default
will never close a half-dead socket.  You can configure the TCP stack to send
KEEPALIVE packets down the pipe.

Dave Wolf
Jaguar Product Team

Guibert Englebienne wrote:

> Is there any way to close a connection to the database server with Jconnect?
> I'm opening a connection from an application run through a cgi script on the
> web. It seems that if there is some kind of problem at runtime, the
> connections are kept open on the server.
> In the documentation, I haven't found any instruction to do this.
> Thanks
> Guibert Englebienne

7/30/1998 8:12:31 PM

Similar Artilces:

Connection.close() not closing my connection?
My servlet calls con.close() within the finally {} of a try..catch block. Yet I notice that sa_conn_info still lists the connection. Shouldn't the connection disappear from the sa_conn_info list when I close it? And if the answer to that is "yes, it should", has anybody seen situations like mine where it *doesn't* close it? Thanks for your help, Kathleen My bad... through a series of really stupid coding mistakes, I managed to cause a SQLException to be thrown from within the finally {} block before the connection could be closed... and I was ignoring the ...

During connection lost, how to close database connection
I'm using TidTCPServer OnExecute method. When client connect to server, I create Database connection with Unidac to PostGreSQL (connection ceated and handled inside onExecute). Problem is when the connection to client is lost, the connection to database does'nt disappear. When cheking from PostGRE pgAdmin there is several connections more than what we have clients. I have tried to put dbConnect.close or FreeandNil(dbConnect) or dbConnect.Free in try.. except.. end except block. But it looks like when the connection is lost, the thread stop/collaps and the database connection stay...

how to close database connection, connection pool issue
I have create a 2.0 application with mysql using the .net/connector 5.1. Most of my pages use a ObjectDataSource control and a Repeater Control. I am calling Close() on both the reader and DB connection but it appears that the connections are not closing and the connection pool gets filled up and I get an error. Does anyone know why the connections aren't closing?  Heres the function that the ObjectDataSource calls:Function myFunc(ByVal subCat As String, ByVal sortBy As String) Dim connStr As String = ConfigurationManager.ConnectionStrings("connector").Co...

close window appliation without connection close of database
 Hello,If i close window application without connection close of database, connection will be closed or it is still there in pool?Thanks VISHAL PAREKH  Hello, If i close window application without connection close of database, connection will be closed or it is still there in pool? Thanks It will be alive unless you close it using Connection.Close()  MAKMark as Answer if this reply helps youMVP ASP/ASP.NetASP.Net Hosting : Host DepotMy Site : ASPSnippets i close window application without connection close of database, co...

Database Connection???How to connect a Database in an other server?
How to connect a Database(.mdb) in an other server? Can I use the connection string like below? mycon.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=http://www.****.com/***/mydb.mdb" You can not. That simple. Access is file based. No a client/server architecture.Thomas TomiczekPowerNodes ApS(Microsoft MVP C#/.NET)---Building a Website? Try the PowerNodes CMS - Correction: you can. Just make sure you can reach the acces db file - through a file share that is bound as drive. Not that you should. Performance will be horrib...

How to close database connection
HI guys, I have the following code that instantiates my data layer and connect to the database. I then retun the DataSet back to the codebehind. When/Where do I close the database connection? If I close the connection on the datalayer my codebehind gives me 'connection is closed' errors. So.. where do I close the connection? THanks! --- users.aspx.vb --- Dim allUsers As New XYZ.adminDim userDataTable As New DataSetuserDataTable = allUsers.GetUsers() do what i need to with userDataTableblahblah --- admin.vb --- Public Function GetUsers() As DataSet''Create a connection to the datab...

closing all database connections
Hi, I'm using a SQL database for my project in c#. At the moment I'm building a page where you can backup the database. But I always get the error that the database is in use when I test it online (some people already use the project). Is there any way to close ALL connections and not only mine. At the moment this I have:   string connectionStringName = ConfigurationManager.AppSettings["connectionStringName"]; Database _db = PIHBE.Data.Common.Database.GetInstance(connectionStringName); _db.Close(); _db.Dispose(); _db.ClearAllPools(); int iVersion = GetVersion(sPath, sDa...

difference between connection.close and command.connection.close
hello, What is the difference between odbcconnection.close and odbccommand.connection.close? I am making connection once in my application in global.asax and opening connection at application_start event and closing it at application_end event. I am accessing connection through "global.myconnection" in webforms. NOw in the webforms,do I have to before comand.executereader?? Does mycommand.connection.close , closes the odbcconnection that I make in gloabl.asax? It is confusing, because on the first function executing on webform, when I myc...

When should I close the database connection
It is said I should close the db connection as soon as possible, but i want to learn the details! thanksWork hard! Play hard! I do not know what details you are looking for. You open late and close early so that the connection can be returned to the connection pool and used by another request.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog...

Closing database connections
I found an article on closing database connections in the finally section of a try block.  This works for everything I have tried except for the database functions that return a data reader.  When I close those I am unable to do a "while" command.  What is the most efficient way to close those? Thank you. Try catch finally is for operations where you expect an exception. In the finally block you clean up what might be left. So if you close the connection, after that, you cannot read from the database (as you have noticed). You can try to read everything i...

underlying connection was closed: The connection was closed unexpectedly
Hi ,   I am working with wcf and linq  and i am facing a problem"The underlying connection was closed: The connection was closed unexpectedly. " when i am trying to return my linq query to the client.I tried for changing the code in web.config for client and   Client :   <behaviors> <endpointBehaviors> <behavior name="debuggingBehaviour"> <dataContractSerializer maxItemsInObjectGraph="2147483646" />                 &nb...

Database connection is not closed
Hello, I have a class getData.vb.  In the new method of the class, I open an new connection to the database. From each page on load event, when I need to get data from database, I dim _getData as new getData, and at the end of page load I have a Finally _getData.dispose.  In the dispose module, I close the database connection. In the getData class, I have a function which returns a dataReader. Of course, when I create a new data reader, I create a new connection. When I need the data reader from page, I have the code dr = _getData.getDataReader, ...

Database connection does not close?!?
Okay. I think I have tolerated this long enough. At first it was just a little annoyance, now it completely ticks me off and is taking up too much of my time. Whenever I use a OledbDataReader on a page, it locks up my MS Access Database with a .lbd file. I use a DataHandler vb page for calling my function for using the datareader. Here is the function within my DataHandler: Public Shared Function GetDataReader(ByVal strSQL As String, ByVal strConn As String) As OleDbDataReader Dim dr As OleDbDataReader Dim cmd As New OleDbCommand With cmd .Connection = New OleDbConnection(strConn) .C...

Close the Database Connection
Hi, I want a DB connection to remain open as long as my application is running, and close when my application exits. Is there any OnExit event that I can call anywhere and have the connection close in there ? Thanks, -Apurva. Application_OnEnd Application_OnEnd is raised only once during an application's lifetime, on the last instance of HttpApplication that is torn down. Use Application_OnEnd only to clean up states or resources shared by all pipeline instances, such as the use of the ApplicationState object, or in your case, database resources. You'll want to add this call...

Web resources about - How to close a connection to the database - sybase.jconnect30

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video -
If you send more email, you might make more money. Then again, you might destroy your reputation and revenue stream. Here's how to know what ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

MOTHER’S DAY: Facebook Examines Connections Between Moms, Kids
With Mother’s Day on the calendar this coming Sunday, Facebook examined the relationships between mothers and their children on the social network, ...

Paris attacks: Belgium connection probed as terrorist past of Brussels district of Molenbeek under spotlight ...
Prosecutors reveal a growing Belgian connection to the deadly Paris attacks, focusing on a poor Brussels district.

Half of data connections by top 500 Android apps are 'covert' with no effect on user experience
Researchers at the Massachusetts Institute of Technology have discovered that half of the communications connections established by the top free ...

Don’t Let Great Content Fall on Deaf Ears: Know your Connection Strategy
... via employee newsletter when it should have come through small-group manager meetings All of these and more are the result of a faulty connection ...

Brussels Connection Under Spotlight After Paris Killings
(EurActiv) — Prosecutors on Sunday disclosed a growing Belgian connection to the Paris attacks as Premier Charles Michel conceded that a Brussels ...

Be Goofy, Smile At Your Baby: Protection Begins with Connection, Pediatrician Says
VideoPart 3 of a series Andrew Garner wears silly ties and finds it easy to make a goofy face. These are valuable tools for charming the babies ...

Get ready for live-streamed extreme sports: Seattle startup Sioeye adds 4G connection to action cam
The history of people doing crazy stunts on camera is full of notable achievements. Motorcycle daredevil Evel Knievel jumped over whatever he ...

Resources last updated: 11/26/2015 8:38:39 AM