Home Dashboard Directory Help
Search

JDBC Sql Server 2005 Express SQLServerException sp_addlinkedserver by 4145E371-4B19-43E3-8688-4976D10D0830


Status: 

Active


0
0
Sign in
to vote
Type: Bug
ID: 145369
Opened: 6/23/2006 6:27:58 PM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Receive random SQLServerException

com.microsoft.sqlserver.jdbc.SQLServerException: Could not find server 'ELADEV\SQLEXPRESS' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.putRowRPC(Unknown Source)
    at com.microsoft.sqlserver.jdbc.ServerFetchBuffer.updateRow(Unknown Source)
    at com.microsoft.sqlserver.jdbc.ForwardOnlyDynamicServerCursor.updateRow(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.updateRow(Unknown Source)
    at service.ContactMergeService.setPrimaryContactData(Unknown Source)


Random nature:
The error has a random nature. I've gotten an exception only on specific record entries, on specific database instances, NOT every record every time. It works fine with some 2000 and 2005 installations. Hence, I'm not sure how to analysis and discover the problem. Is there a specific configuration of a record entry that could cause the problem?

JVM: 1.5.0_07
JDBC: Driver: Microsoft SQL Server 2005 JDBC Driver Version 1.0 from sqljdbc_1.0.809.102_enu.exe

Code snippet:
The problem happens it both result.updateRow and select.executeUpdate mode.

updateRow:
    ResultSet result = select.executeQuery(query);
    
    if( result.next()) {
        // update values on the result set.
        result.updateString(....);

        result.updateRow();
    }

executeUpdate:
    updateBuffer.append("UPDATE contact SET ");
    updateBuffer.append("FNAME='Malcolm'");
    updateBuffer.append("WHERE contactid = 'UV1234'");
    select.executeUpdate(updateBuffer.toString());
Details
Sign in to post a comment.
Posted by Microsoft on 10/29/2007 at 3:56 PM
Hi Malcolm,

Since you say that you're only getting this error on specific database instances, I'm wondering if you aren't running into the issue mentioned in this thread (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=274270&SiteID=1) on the MSDN forums. If that doesn't help you, please update this feedback.

Thank you,
SQL Server JDBC team.
Sign in to post a workaround.
Posted by MalcolmDavis on 1/31/2008 at 12:09 PM
The real issue is that the SQLServerException sp_addlinkedserver is due to a bad query, and the wrong exception is being thrown.