Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Tuesday, March 20, 2012

Connections not closing?

Hi, hoping someone can offer some explanations.
I've rigorously checked my java code and confirmed that every place I open a connection is done in a try {} block and the connection is closed in the follwoing finally {} block. There is one exception to this. I'm using the log4j JDBCAppender which open
s a single connection to the database and keeps that connection open.
Looking at the performance monitor, I can see that I have many, many open connections. Looking at SQLServer, though, I see that these are all sleeping.
Any thoughts on this? I did notice this page http://support.microsoft.com/default...;en-us;313220. Could that be what I'm seeing? If so, will additional writes over that connection re-use the implicitly opened connections?
Thanks for any help.
I'd have to see the code, but it hints at
a multithreading issue. I'll bet it goes away
if you *define* the connection as a method-scoped
variable, in the method(s) where it's used, just
before the try block that sets it. That way,
two simultaneous threads won't set the same variable
with two newly-obtained connections, with the last one
overwriting the first, both using and closing the second,
and the first hangs till GC'ed and maybe never closed...
Joe Weinstein at BEA
Chris Baird wrote:

> Hi, hoping someone can offer some explanations.
> I've rigorously checked my java code and confirmed that every place I open a connection is done in a try {} block and the connection is closed in the follwoing finally {} block. There is one exception to this. I'm using the log4j JDBCAppender which op
ens a single connection to the database and keeps that connection open.
> Looking at the performance monitor, I can see that I have many, many open connections. Looking at SQLServer, though, I see that these are all sleeping.
> Any thoughts on this? I did notice this page http://support.microsoft.com/default...;en-us;313220. Could that be what I'm seeing? If so, will additional writes over that connection re-use the implicitly opened connections?
> Thanks for any help.
|||Thanks, Joe.
Actually, my only connection definitions are method scoped. The only one that does not fit this is for the log4j JDBCAppender; however, only one instance of that class is created. All of my methods that use connections look like:
Connection connection = null;
try {
connection = getConnection();
// do stuff
} finally {
closeConnection(connection);
}
Where getConnection() does the normal DriverManager call and closeConnection() just ensures that the passed connection object is not null before trying to close it.
|||Ok, then
Chris Baird wrote:
> Thanks, Joe.
> Actually, my only connection definitions are method scoped. The only one that does not fit this is for the log4j JDBCAppender; however, only one instance of that class is created. All of my methods that use connections look like:
> Connection connection = null;
> try {
> connection = getConnection();
> // do stuff
> } finally {
> closeConnection(connection);
> }
> Where getConnection() does the normal DriverManager call and closeConnection() just ensures that the passed connection object is not null before trying to close it.
Ok. The code looks good then. Here's what I would do: Whenever I got a connection,
I would record or print out the spid, and whenever I closed a connection I would
again print out it's spid before closing. In fact I might query *all* the spids
before closing one, and after (via another connection). The only suspect might
be the driver itself pooling connections. Ah, but note that this driver, unless you
set selectMethod=cursor, will create cloned connections under the covers to
implement multiple concurrent statements. If you're sure to use only one statement
at a time, and close it before opening another, it might go away.
Joe Weinstein at BEA
sqlsql

connections not closed by app

we inherited this java web app that uses a jdbc-odbc bridge for connecting
to 2 sql server 2000 instances. there are probably hundreds of places in
the application where connections are not being closed (resultsets and
statements not being closed as well).
my question:
1) i assume that as DBAs you would all frown on this? do you have
suggestions about doing something on the db side to address this?
2) what i though was something like: does sql server automatically (or can
i make it) close connections after a peroid of time? would that work?Dont know that I would actually do this, but if all else fails:
1; sp_who2 into a temp table
2; have a cursor loop through the LastBatch column, using dynamic sql, and
KILL everything > 5 minutes. (Or whatever time you decide on.)
I would really try to exhaust all other resources before using this method,
just an idea to keep in mind in case you get this deperate.
--
TIA,
ChrisR
"usenetjb" wrote:
> we inherited this java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?
>|||Wow. The program must be fixed but for now, I would consider setting up a
schedule to reboot the server at night.
"usenetjb" <usenet.20.jimbo-black@.antichef.net> wrote in message
news:Xns97335385B8126usenetjb@.207.115.17.102...
> we inherited this java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?|||"Grant" <email@.nowhere.com> wrote in
news:uUcMfmzBGHA.3572@.TK2MSFTNGP14.phx.gbl:
> Wow. The program must be fixed but for now, I would consider setting
> up a schedule to reboot the server at night.
>
>
wow is not what i said, but then again ... believe it or not the app has
to be up 24/7. so we generally reboot the box after a week to make the app
speed up, sigh. it is leaking resources all over the place on the java app
side.
anyway, can sql server reboot itself? do you have any suggestions in terms
of tools to automate this sql server reboot?
thx

connections not closed by app

we inherited this Java web app that uses a jdbc-odbc bridge for connecting
to 2 sql server 2000 instances. there are probably hundreds of places in
the application where connections are not being closed (resultsets and
statements not being closed as well).
my question:
1) i assume that as DBAs you would all frown on this? do you have
suggestions about doing something on the db side to address this?
2) what i though was something like: does sql server automatically (or can
i make it) close connections after a peroid of time? would that work?Dont know that I would actually do this, but if all else fails:
1; sp_who2 into a temp table
2; have a cursor loop through the LastBatch column, using dynamic sql, and
KILL everything > 5 minutes. (Or whatever time you decide on.)
I would really try to exhaust all other resources before using this method,
just an idea to keep in mind in case you get this deperate.
TIA,
ChrisR
"usenetjb" wrote:

> we inherited this Java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?
>|||Wow. The program must be fixed but for now, I would consider setting up a
schedule to reboot the server at night.
"usenetjb" <usenet.20.jimbo-black@.antichef.net> wrote in message
news:Xns97335385B8126usenetjb@.207.115.17.102...
> we inherited this Java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?|||"Grant" <email@.nowhere.com> wrote in
news:uUcMfmzBGHA.3572@.TK2MSFTNGP14.phx.gbl:

> Wow. The program must be fixed but for now, I would consider setting
> up a schedule to reboot the server at night.
>
>
wow is not what i said, but then again ... believe it or not the app has
to be up 24/7. so we generally reboot the box after a week to make the app
speed up, sigh. it is leaking resources all over the place on the Java app
side.
anyway, can sql server reboot itself? do you have any suggestions in terms
of tools to automate this sql server reboot?
thx

connections not closed by app

we inherited this java web app that uses a jdbc-odbc bridge for connecting
to 2 sql server 2000 instances. there are probably hundreds of places in
the application where connections are not being closed (resultsets and
statements not being closed as well).
my question:
1) i assume that as DBAs you would all frown on this? do you have
suggestions about doing something on the db side to address this?
2) what i though was something like: does sql server automatically (or can
i make it) close connections after a peroid of time? would that work?
Dont know that I would actually do this, but if all else fails:
1; sp_who2 into a temp table
2; have a cursor loop through the LastBatch column, using dynamic sql, and
KILL everything > 5 minutes. (Or whatever time you decide on.)
I would really try to exhaust all other resources before using this method,
just an idea to keep in mind in case you get this deperate.
TIA,
ChrisR
"usenetjb" wrote:

> we inherited this java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?
>
|||Wow. The program must be fixed but for now, I would consider setting up a
schedule to reboot the server at night.
"usenetjb" <usenet.20.jimbo-black@.antichef.net> wrote in message
news:Xns97335385B8126usenetjb@.207.115.17.102...
> we inherited this java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?
|||"Grant" <email@.nowhere.com> wrote in
news:uUcMfmzBGHA.3572@.TK2MSFTNGP14.phx.gbl:

> Wow. The program must be fixed but for now, I would consider setting
> up a schedule to reboot the server at night.
>
>
wow is not what i said, but then again ... believe it or not the app has
to be up 24/7. so we generally reboot the box after a week to make the app
speed up, sigh. it is leaking resources all over the place on the java app
side.
anyway, can sql server reboot itself? do you have any suggestions in terms
of tools to automate this sql server reboot?
thx

Monday, March 19, 2012

Connection.TRANSACTION_SERIALIZABLE

I have a java developer using a connection setting of
Connection.TRANSACTION_SERIALIZABLE to our SQL Server. How does this
connection setting interact with the code it touches? If it calls a stored
procedure that is using a nolock hint will it ignore it?
Thank!
This doesn't appear to be an ODBC issue. Perhaps if you can't get a
response in this alias you could try a Java or JDBC alias?
| Thread-Topic: Connection.TRANSACTION_SERIALIZABLE
| thread-index: AcWsS/nqoR9CPWgEQMKylP56fG3lXw==
| X-WBNR-Posting-Host: 199.181.134.212
| From: "=?Utf-8?B?TWljaGFlbFc=?=" <MichaelW@.discussions.microsoft.com>
| Subject: Connection.TRANSACTION_SERIALIZABLE
| Date: Sun, 28 Aug 2005 20:44:36 -0700
| Lines: 6
| Message-ID: <FC25F063-3ECA-42A7-9095-642ECCDB8CBC@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.odbc
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2628
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| I have a java developer using a connection setting of
| Connection.TRANSACTION_SERIALIZABLE to our SQL Server. How does this
| connection setting interact with the code it touches? If it calls a
stored
| procedure that is using a nolock hint will it ignore it?
|
| Thank!
|
|||I'm not seeing a JDBC section on here. Using non Microsoft JDBC connectiong
to SQL server.
"Warren Read" wrote:

> This doesn't appear to be an ODBC issue. Perhaps if you can't get a
> response in this alias you could try a Java or JDBC alias?
> --
> | Thread-Topic: Connection.TRANSACTION_SERIALIZABLE
> | thread-index: AcWsS/nqoR9CPWgEQMKylP56fG3lXw==
> | X-WBNR-Posting-Host: 199.181.134.212
> | From: "=?Utf-8?B?TWljaGFlbFc=?=" <MichaelW@.discussions.microsoft.com>
> | Subject: Connection.TRANSACTION_SERIALIZABLE
> | Date: Sun, 28 Aug 2005 20:44:36 -0700
> | Lines: 6
> | Message-ID: <FC25F063-3ECA-42A7-9095-642ECCDB8CBC@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.sqlserver.odbc
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2628
> | X-Tomcat-NG: microsoft.public.sqlserver.odbc
> |
> | I have a java developer using a connection setting of
> | Connection.TRANSACTION_SERIALIZABLE to our SQL Server. How does this
> | connection setting interact with the code it touches? If it calls a
> stored
> | procedure that is using a nolock hint will it ignore it?
> |
> | Thank!
> |
>
|||Try microsoft.public.sqlserver.jdbcdriver
Perhaps someone on this alias can address your question.
Good luck!
| Thread-Topic: Connection.TRANSACTION_SERIALIZABLE
| thread-index: AcWujdAXO+ZlWwwzSwq0xDayA4RnlA==
| X-WBNR-Posting-Host: 199.181.134.212
| From: "=?Utf-8?B?TWljaGFlbFc=?=" <MichaelW@.discussions.microsoft.com>
| References: <FC25F063-3ECA-42A7-9095-642ECCDB8CBC@.microsoft.com>
<sBlO1worFHA.1204@.TK2MSFTNGXA01.phx.gbl>
| Subject: RE: Connection.TRANSACTION_SERIALIZABLE
| Date: Wed, 31 Aug 2005 17:40:55 -0700
| Lines: 41
| Message-ID: <29F51F66-4E80-452C-B2CC-D27A28063A20@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.odbc
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2648
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| I'm not seeing a JDBC section on here. Using non Microsoft JDBC
connectiong
| to SQL server.
|
| "Warren Read" wrote:
|
| > This doesn't appear to be an ODBC issue. Perhaps if you can't get a
| > response in this alias you could try a Java or JDBC alias?
| > --
| > | Thread-Topic: Connection.TRANSACTION_SERIALIZABLE
| > | thread-index: AcWsS/nqoR9CPWgEQMKylP56fG3lXw==
| > | X-WBNR-Posting-Host: 199.181.134.212
| > | From: "=?Utf-8?B?TWljaGFlbFc=?=" <MichaelW@.discussions.microsoft.com>
| > | Subject: Connection.TRANSACTION_SERIALIZABLE
| > | Date: Sun, 28 Aug 2005 20:44:36 -0700
| > | Lines: 6
| > | Message-ID: <FC25F063-3ECA-42A7-9095-642ECCDB8CBC@.microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.sqlserver.odbc
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2628
| > | X-Tomcat-NG: microsoft.public.sqlserver.odbc
| > |
| > | I have a java developer using a connection setting of
| > | Connection.TRANSACTION_SERIALIZABLE to our SQL Server. How does this
| > | connection setting interact with the code it touches? If it calls a
| > stored
| > | procedure that is using a nolock hint will it ignore it?
| > |
| > | Thank!
| > |
| >
| >
|

Connection.TRANSACTION_SERIALIZABLE

I have a Java developer using a connection setting of
Connection.TRANSACTION_SERIALIZABLE to our SQL Server. How does this
connection setting interact with the code it touches? If it calls a stored
procedure that is using a nolock hint will it ignore it?
Thank!This doesn't appear to be an ODBC issue. Perhaps if you can't get a
response in this alias you could try a Java or JDBC alias?
--
| Thread-Topic: Connection.TRANSACTION_SERIALIZABLE
| thread-index: AcWsS/nqoR9CPWgEQMKylP56fG3lXw==
| X-WBNR-Posting-Host: 199.181.134.212
| From: "examnotes" <MichaelW@.discussions.microsoft.com>
| Subject: Connection.TRANSACTION_SERIALIZABLE
| Date: Sun, 28 Aug 2005 20:44:36 -0700
| Lines: 6
| Message-ID: <FC25F063-3ECA-42A7-9095-642ECCDB8CBC@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.odbc
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2628
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| I have a Java developer using a connection setting of
| Connection.TRANSACTION_SERIALIZABLE to our SQL Server. How does this
| connection setting interact with the code it touches? If it calls a
stored
| procedure that is using a nolock hint will it ignore it?
|
| Thank!
||||I'm not seeing a JDBC section on here. Using non Microsoft JDBC connectiong
to SQL server.
"Warren Read" wrote:

> This doesn't appear to be an ODBC issue. Perhaps if you can't get a
> response in this alias you could try a Java or JDBC alias?
> --
> | Thread-Topic: Connection.TRANSACTION_SERIALIZABLE
> | thread-index: AcWsS/nqoR9CPWgEQMKylP56fG3lXw==
> | X-WBNR-Posting-Host: 199.181.134.212
> | From: "examnotes" <MichaelW@.discussions.microsoft.com>
> | Subject: Connection.TRANSACTION_SERIALIZABLE
> | Date: Sun, 28 Aug 2005 20:44:36 -0700
> | Lines: 6
> | Message-ID: <FC25F063-3ECA-42A7-9095-642ECCDB8CBC@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.sqlserver.odbc
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2628
> | X-Tomcat-NG: microsoft.public.sqlserver.odbc
> |
> | I have a Java developer using a connection setting of
> | Connection.TRANSACTION_SERIALIZABLE to our SQL Server. How does this
> | connection setting interact with the code it touches? If it calls a
> stored
> | procedure that is using a nolock hint will it ignore it?
> |
> | Thank!
> |
>|||Try microsoft.public.sqlserver.jdbcdriver
Perhaps someone on this alias can address your question.
Good luck!
--
| Thread-Topic: Connection.TRANSACTION_SERIALIZABLE
| thread-index: AcWujdAXO+ZlWwwzSwq0xDayA4RnlA==
| X-WBNR-Posting-Host: 199.181.134.212
| From: "examnotes" <MichaelW@.discussions.microsoft.com>
| References: <FC25F063-3ECA-42A7-9095-642ECCDB8CBC@.microsoft.com>
<sBlO1worFHA.1204@.TK2MSFTNGXA01.phx.gbl>
| Subject: RE: Connection.TRANSACTION_SERIALIZABLE
| Date: Wed, 31 Aug 2005 17:40:55 -0700
| Lines: 41
| Message-ID: <29F51F66-4E80-452C-B2CC-D27A28063A20@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.odbc
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2648
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| I'm not seeing a JDBC section on here. Using non Microsoft JDBC
connectiong
| to SQL server.
|
| "Warren Read" wrote:
|
| > This doesn't appear to be an ODBC issue. Perhaps if you can't get a
| > response in this alias you could try a Java or JDBC alias?
| > --
| > | Thread-Topic: Connection.TRANSACTION_SERIALIZABLE
| > | thread-index: AcWsS/nqoR9CPWgEQMKylP56fG3lXw==
| > | X-WBNR-Posting-Host: 199.181.134.212
| > | From: "examnotes" <MichaelW@.discussions.microsoft.com>
| > | Subject: Connection.TRANSACTION_SERIALIZABLE
| > | Date: Sun, 28 Aug 2005 20:44:36 -0700
| > | Lines: 6
| > | Message-ID: <FC25F063-3ECA-42A7-9095-642ECCDB8CBC@.microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.sqlserver.odbc
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2628
| > | X-Tomcat-NG: microsoft.public.sqlserver.odbc
| > |
| > | I have a Java developer using a connection setting of
| > | Connection.TRANSACTION_SERIALIZABLE to our SQL Server. How does this
| > | connection setting interact with the code it touches? If it calls a
| > stored
| > | procedure that is using a nolock hint will it ignore it?
| > |
| > | Thank!
| > |
| >
| >
|

Saturday, February 25, 2012

Connection timed out

We are running SQL Server 2000 Version 8.00.760. We are running our
application using Java. We are frequently getting Connection Timed Out in
our appserver. Is anyone aware of such an issue this version of SQL Server
? We have similar configurations on several other servers, but only the
appserver's connected to this particular database is giving connection
timeouts. Is this a known bug ? or are we hit with a virus ?
I searched Google, but did not find any info.
-Nags
Nags,
The "application timeout" usually means that the driver or the client code
has some sort of timeout within which, if sql server doesnt execute and
return the query, then it times out. For example, I think the default at
the ODBC driver setting is 30 seconds.
That leads us to the next question - why is it taking 30 seconds or more
(I'm making the assumption here that 30 sec is your default timeout as
well). I'm also making another assumption - that the other configurations
you have are EXACTLY like this "problem server" configuation which includes
the same amt of tables, and the same amt of data in these tables. And that,
there was a time maybe when things were fine on this "problem" server.
A couple of things you'd want ot check -
1. Does this happen for any query/hit against the sql server? example, even
logging on (user name/password) results in a timeout?
2. Does it happen for a set of queries?
3. If you know the queries that are commonly executed by this application,
OR some of the queries that you've seen timeout. Take those queries in
Query analyser and see how long they run.
4. Try updating statistics on the tables.
5. Compare index structures on the tables on the 'good' db's with their
counterparts on this problem db.
Hope this helps.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
|||I'm facing the pro as well.
I look into error log, it said 'Server terminating due to 'Stop' request
from Service Control Manager'. The db server also using the Autogrowth
option, and everytime it growing the log file, seems like the server stop
responding.
Pls advise.
Thanks in advance.
"Vikram Jayaram [MS]" wrote:

> Nags,
> The "application timeout" usually means that the driver or the client code
> has some sort of timeout within which, if sql server doesnt execute and
> return the query, then it times out. For example, I think the default at
> the ODBC driver setting is 30 seconds.
> That leads us to the next question - why is it taking 30 seconds or more
> (I'm making the assumption here that 30 sec is your default timeout as
> well). I'm also making another assumption - that the other configurations
> you have are EXACTLY like this "problem server" configuation which includes
> the same amt of tables, and the same amt of data in these tables. And that,
> there was a time maybe when things were fine on this "problem" server.
> A couple of things you'd want ot check -
> 1. Does this happen for any query/hit against the sql server? example, even
> logging on (user name/password) results in a timeout?
> 2. Does it happen for a set of queries?
> 3. If you know the queries that are commonly executed by this application,
> OR some of the queries that you've seen timeout. Take those queries in
> Query analyser and see how long they run.
> 4. Try updating statistics on the tables.
> 5. Compare index structures on the tables on the 'good' db's with their
> counterparts on this problem db.
> Hope this helps.
> Vikram Jayaram
> Microsoft, SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
>
>

Connection timed out

We are running SQL Server 2000 Version 8.00.760. We are running our
application using Java. We are frequently getting Connection Timed Out in
our appserver. Is anyone aware of such an issue this version of SQL Server
? We have similar configurations on several other servers, but only the
appserver's connected to this particular database is giving connection
timeouts. Is this a known bug ? or are we hit with a virus ?
I searched Google, but did not find any info.
-NagsNags,
The "application timeout" usually means that the driver or the client code
has some sort of timeout within which, if sql server doesnt execute and
return the query, then it times out. For example, I think the default at
the ODBC driver setting is 30 seconds.
That leads us to the next question - why is it taking 30 seconds or more
(I'm making the assumption here that 30 sec is your default timeout as
well). I'm also making another assumption - that the other configurations
you have are EXACTLY like this "problem server" configuation which includes
the same amt of tables, and the same amt of data in these tables. And that,
there was a time maybe when things were fine on this "problem" server.
A couple of things you'd want ot check -
1. Does this happen for any query/hit against the sql server? example, even
logging on (user name/password) results in a timeout?
2. Does it happen for a set of queries?
3. If you know the queries that are commonly executed by this application,
OR some of the queries that you've seen timeout. Take those queries in
Query analyser and see how long they run.
4. Try updating statistics on the tables.
5. Compare index structures on the tables on the 'good' db's with their
counterparts on this problem db.
Hope this helps.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.|||I'm facing the pro as well.
I look into error log, it said 'Server terminating due to 'Stop' request
from Service Control Manager'. The db server also using the Autogrowth
option, and everytime it growing the log file, seems like the server stop
responding.
Pls advise.
Thanks in advance.
"Vikram Jayaram [MS]" wrote:

> Nags,
> The "application timeout" usually means that the driver or the client code
> has some sort of timeout within which, if sql server doesnt execute and
> return the query, then it times out. For example, I think the default at
> the ODBC driver setting is 30 seconds.
> That leads us to the next question - why is it taking 30 seconds or more
> (I'm making the assumption here that 30 sec is your default timeout as
> well). I'm also making another assumption - that the other configurations
> you have are EXACTLY like this "problem server" configuation which include
s
> the same amt of tables, and the same amt of data in these tables. And that
,
> there was a time maybe when things were fine on this "problem" server.
> A couple of things you'd want ot check -
> 1. Does this happen for any query/hit against the sql server? example, eve
n
> logging on (user name/password) results in a timeout?
> 2. Does it happen for a set of queries?
> 3. If you know the queries that are commonly executed by this application,
> OR some of the queries that you've seen timeout. Take those queries in
> Query analyser and see how long they run.
> 4. Try updating statistics on the tables.
> 5. Compare index structures on the tables on the 'good' db's with their
> counterparts on this problem db.
> Hope this helps.
> Vikram Jayaram
> Microsoft, SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
>
>

Connection timed out

We are running SQL Server 2000 Version 8.00.760. We are running our
application using Java. We are frequently getting Connection Timed Out in
our appserver. Is anyone aware of such an issue this version of SQL Server
? We have similar configurations on several other servers, but only the
appserver's connected to this particular database is giving connection
timeouts. Is this a known bug ? or are we hit with a virus ?
I searched Google, but did not find any info.
-NagsNags,
The "application timeout" usually means that the driver or the client code
has some sort of timeout within which, if sql server doesnt execute and
return the query, then it times out. For example, I think the default at
the ODBC driver setting is 30 seconds.
That leads us to the next question - why is it taking 30 seconds or more
(I'm making the assumption here that 30 sec is your default timeout as
well). I'm also making another assumption - that the other configurations
you have are EXACTLY like this "problem server" configuation which includes
the same amt of tables, and the same amt of data in these tables. And that,
there was a time maybe when things were fine on this "problem" server.
A couple of things you'd want ot check -
1. Does this happen for any query/hit against the sql server? example, even
logging on (user name/password) results in a timeout?
2. Does it happen for a set of queries?
3. If you know the queries that are commonly executed by this application,
OR some of the queries that you've seen timeout. Take those queries in
Query analyser and see how long they run.
4. Try updating statistics on the tables.
5. Compare index structures on the tables on the 'good' db's with their
counterparts on this problem db.
Hope this helps.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.|||I'm facing the pro as well.
I look into error log, it said 'Server terminating due to 'Stop' request
from Service Control Manager'. The db server also using the Autogrowth
option, and everytime it growing the log file, seems like the server stop
responding.
Pls advise.
Thanks in advance.
"Vikram Jayaram [MS]" wrote:
> Nags,
> The "application timeout" usually means that the driver or the client code
> has some sort of timeout within which, if sql server doesnt execute and
> return the query, then it times out. For example, I think the default at
> the ODBC driver setting is 30 seconds.
> That leads us to the next question - why is it taking 30 seconds or more
> (I'm making the assumption here that 30 sec is your default timeout as
> well). I'm also making another assumption - that the other configurations
> you have are EXACTLY like this "problem server" configuation which includes
> the same amt of tables, and the same amt of data in these tables. And that,
> there was a time maybe when things were fine on this "problem" server.
> A couple of things you'd want ot check -
> 1. Does this happen for any query/hit against the sql server? example, even
> logging on (user name/password) results in a timeout?
> 2. Does it happen for a set of queries?
> 3. If you know the queries that are commonly executed by this application,
> OR some of the queries that you've seen timeout. Take those queries in
> Query analyser and see how long they run.
> 4. Try updating statistics on the tables.
> 5. Compare index structures on the tables on the 'good' db's with their
> counterparts on this problem db.
> Hope this helps.
> Vikram Jayaram
> Microsoft, SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
>
>

Connection string to SQL Server database

I am a java programmer and currently developing a web application that is suposed to keep records of all Computers that are purchased or written off. I have my database sitting at MSSQL server express ed. 2005 and so far i only know to connect to Access DB. Can someone help me with the syntax to connect to MSSQL server.

reply to [email removed]

Quote:

Originally Posted by Java25

I am a java programmer and currently developing a web application that is suposed to keep records of all Computers that are purchased or written off. I have my database sitting at MSSQL server express ed. 2005 and so far i only know to connect to Access DB. Can someone help me with the syntax to connect to MSSQL server.

reply to Me


Check this site .. and you ll find the connections to all the existing databases in the world ;-) .. it really worked for me and I am using this for the past 4 yrs.

http://www.connectionstrings.com/

HTH..