RE: The DBMS returned an unspecified error.
From: Carb Simien [MSFT] (CarbinoS_at_online.microsoft.com)
Date: 02/01/05
- Next message: Hamelech Al Hakol: "how to use datetime range in prepare statement"
- Previous message: Alin Sinpalean: "Re: Sp_CursorOpen,Fetch,Close"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 01 Feb 2005 17:42:57 GMT
--------------------
| Thread-Topic: The DBMS returned an unspecified error.
| thread-index: AcT/MBgcGul+jn5ARu2BbB/ZscfTow==
| X-WBNR-Posting-Host: 208.4.167.254
| From: =?Utf-8?B?QWxsZW4gRS4gU2NoYXJmZW5iZXJn?=
<AllenEScharfenberg@discussions.microsoft.com>
| Subject: The DBMS returned an unspecified error.
| Date: Thu, 20 Jan 2005 12:39:10 -0800
| Lines: 114
| Message-ID: <A5DD49EA-84C5-4797-9F51-C945E0E40A13@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.jdbcdriver
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6598
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| We are using Microsoft's JDBC driver for Java database access to SQL
Server
| 2000 databases and have stumbled across a problem. When running a
somewhat
| intense process (inserting fairly large batches of information in a
| transaction), we get the following exception from the JDBC driver:
|
| EXCEPTION TYPE: java.sql.SQLException
| LEVEL: 2
| MESSAGE: [Microsoft][SQLServer JDBC Driver]The DBMS returned an
unspecified
| error.
| STACK TRACE:
| at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
| at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
| at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown
| Source)
| at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown
| Source)
| at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown
Source)
| at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown
| Source)
| at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown
| Source)
| at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
| at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)
| at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)
| at com.msfw.data.db.SQLExecutor.execute(SQLExecutor.java:46)
| ...
| at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
| at
|
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButto
n.java:1839)
| at
|
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4
20)
| at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
| at
|
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener
.java:245)
| at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
| at java.awt.Component.processMouseEvent(Component.java:5100)
| at java.awt.Component.processEvent(Component.java:4897)
| at java.awt.Container.processEvent(Container.java:1569)
| at java.awt.Component.dispatchEventImpl(Component.java:3615)
| at java.awt.Container.dispatchEventImpl(Container.java:1627)
| at java.awt.Component.dispatchEvent(Component.java:3477)
| at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
| at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
| at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
| at java.awt.Container.dispatchEventImpl(Container.java:1613)
| at java.awt.Window.dispatchEventImpl(Window.java:1606)
| at java.awt.Component.dispatchEvent(Component.java:3477)
| at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
| at
|
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:201)
| at
|
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:151)
| at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
| at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
| at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
|
| All of our SQL statements run through the following method. The five
| methods that call this method all have finally clauses that close the
result
| sets and prepared statements:
|
| public static final ResultSet execute(final PreparedStatement
statement)
| throws SQLException, NullPointerException {
|
| if (statement == null)
| {
| throw new NullPointerException();
| }
| ResultSet rs = null;
|
| try
| {
| boolean hasResultSet = statement.execute();
| if (hasResultSet)
| {
| rs = statement.getResultSet();
| }
| return rs;
| }
| catch (SQLException t)
| {
| throw t;
| }
| } // end execute
|
| The following message is logged to the machine's application log:
|
| Error: 17803, Severity: 20, State: 12
| Insufficient memory available.
|
| Interestingly, even though SQL Server 2000 is configured to use up to the
| maximum physical memory of the machine, this problem occurs when the
process
| itself (as inspected through the Task Manager) is only using 200 MB of
memory
| at the most. We have performed a trace using SQL Server's tracing tool,
but
| it did not indicate anything obvious. Thus, we are currently puzzled as
to
| how SQL Server could be claiming that there is not enough memory
available.
|
| I have tested this with the SP3 of the JDBC driver (just to make sure
that
| it was not a problem that has already been fixed), but the problem still
| occurs. I have been around and around the Internet looking at newsgroups
and
| forums to try to discern the cause or a solution for this problem, all to
no
| avail. One Microsoft Knowledge Base (KB 820773), however, does describe
a
| problem found in the SP2 of the JDBC driver with the exact same
symptomology
| of our current problem. The article discusses how a bug in the driver
caused
| memory leaks on statements that did not return result sets. I tried the
| various workaround presented in that article hoping that they would get
| around this similar problem but have not had any luck.
|
| This is occuring at a client's site as well as in each of our local test
| environments, thus ruling it out as a configuration problem.
|
| Any help on this would be much appreciated.
|
| --
| Allen E. Scharfenberg
|
The 17803 error represents a generic out of memory condition in SQL Server
with several possible root causes. The first thing that should be
determined is whether the memory pressure occurs in either the standard
data buffer pool or the MemToLeave memory pool. You should check the SQL
Server error logs to see which errors accompany the 17803 error. If you
see errors like the following, the problem is most likely in the MemToLeave
memory pool:
WARNING: Failed to reserve contiguous memory of Size= 65536.
WARNING: Clearing procedure cache to free contiguous memory.
Error: 17802, Severity: 18, State: 3 Could not create server event thread.
SQL Server could not spawn process_loginread thread
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'SQLOLEDB' reported an error. The provider ran out of
memory.
Otherwise, the problem is most likely in the buffer pool (BPool). In the
case of MemToLeave pressure, you should find out if there are any other
applications running on the box that use linked server queries, extended
stored procedures, etc. Also check the "network packet size" from your
sp_configure settings to ensure that it is using the default value of 4096.
In some cases, increasing the -g startup parameter of SQL Server can be
used to increase the size of MemToLeave. "-g256" is the default setting.
In the case of BPool pressure, capturing a Perfmon log is key, and you
should start collecting the data with the following counters from SQL
Server startup until the 17803 errors occur:
* all SQL Server counters
* Memory
* Process
* Processor
* System
* Thread
* Objects
* Paging File
Since the problem only occurs after some time has elapsed, it's very
possible that there are other apps on the SQL Server machine that consume
the MemToLeave buffer.
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
- Next message: Hamelech Al Hakol: "how to use datetime range in prepare statement"
- Previous message: Alin Sinpalean: "Re: Sp_CursorOpen,Fetch,Close"
- Messages sorted by: [ date ] [ thread ]