The DBMS returned an unspecified error.

From: Allen E. Scharfenberg (AllenEScharfenberg_at_discussions.microsoft.com)
Date: 01/20/05

  • Next message: Joe Weinstein: "Re: The DBMS returned an unspecified error."
    Date: Thu, 20 Jan 2005 12:39:10 -0800
    
    

    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(AbstractButton.java:1839)
            at
    javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
            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.java: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
    

  • Next message: Joe Weinstein: "Re: The DBMS returned an unspecified error."
    Loading