Re: ResultSet size limitation
From: Joe Weinstein (joeNOSPAM_at_bea.com)
Date: 04/07/04
- Previous message: Sam Lebron: "Re: ResultSet size limitation"
- In reply to: Sam Lebron: "Re: ResultSet size limitation"
- Next in thread: Sam Lebron: "Re: ResultSet size limitation"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 07 Apr 2004 14:26:24 -0700 To: Sam Lebron <sam.lebron@dressbarn.com>
That's what I would do. Just make a simple standalone
that makes it effortless and foolproof to demonstrate
the bug. I promise that the info will get to those who
can do something about it.
Joe
Sam Lebron wrote:
> Great, thanks for your suggestion. How do I get the
> sample code and script into MS bug report?
>
> Do you I just place it here?
>
>
>>-----Original Message-----
>>
>>
>>Sma Lebron wrote:
>>
>>
>>>Your URL assumption is correct. I started this thread
>
> out
>
>>>by saying I have the latest Microsoft SQLServer jdbc
>>>driver and thought the problem was with that driver and
>
> a
>
>>>ResultSet limitation/bug. What Driver should I be
>
> using
>
>>>ofr a standalone test?
>>
>>Oh, the same, I was just being very careful to ensure that
>>there was zero contribution from the app server. The
>
> reason I
>
>>asked about the URL, is that your code could call
>
> Class.forName()
>
>>for 10 drivers, but DriverManager will give your URL to
>
> every
>
>>loaded driver it knows until it finds one that accepts
>
> your URL,
>
>>so the URL is what determines the connection.
>> So now, the ideal thing would be to supply a 30-line
>
> jdbc
>
>>program that just makes the query that fails for you.
>
> Then show
>
>>a script that creates the relevant table and data. or do
>
> that in the
>
>>simple program, and MS would probably run with it as a
>
> bug report.
>
>>Joe
>>
>>
>>>
>>>
>>>>-----Original Message-----
>>>>
>>>>
>>>>Sam Lebron wrote:
>>>>
>>>>
>>>>
>>>>>I'm using weblogic in staging and production, I'm
>
> using
>
>>>>>WSAD/Eclipse in dev. I get a connection directly from
>>>
>>>the
>>>
>>>
>>>>>MS driver using the Class.forName
>>>>>( "com.microsoft.jdbc.sqlserver.SQLServerDriver");
>>>>
>>>>Ok, and what is the URL you use? Something like
>>>>jdbc:microsoft:sqlserver:..., correct?
>>>>That means whatever problem you're getting is a driver
>>>>issue...
>>>>Joe
>>>>
>>>>
>>>>
>>>>>>-----Original Message-----
>>>>>>
>>>>>>
>>>>>>Sam Lebron wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Thanks for your prompt response.
>>>>>>
>>>>>>sure.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>I have recreated the problem running in a wsad test
>>>>>>>environment.
>>>>>>
>>>>>>WSAD? Does that mean you are running in a standalone
>>>>>
>>>>>program,
>>>>>
>>>>>
>>>>>
>>>>>>not weblogic, and you are getting a jdbc connection
>>>>>
>>>>>directly from
>>>>>
>>>>>
>>>>>
>>>>>>the MS driver?
>>>>>>thanks,
>>>>>>Joe
>>>>>>
>>>>>>
>>>>>>I am reading the rows in the order that they
>>>>>>
>>>>>>
>>>>>>
>>>>>>>are returned and I'm reading the columns left to
>>>>>
>>>>>right. I
>>>>>
>>>>>
>>>>>
>>>>>>>am also using this data to populate a collection of
>>>>>>>PreparedStatement using the addBatch(). The error
>>>>>
>>>>>occurs
>>>>>
>>>>>
>>>>>
>>>>>>>during a column read of the ResultSet. If it helps,
>>>>>
>>>>>I've
>>>>>
>>>>>
>>>>>
>>>>>>>pated the method below,
>>>>>>>
>>>>>>>private PreparedStatement processPhotographyDetail(
>>>>>>> Statement updateStmt,
>>>>>>>
>>>>>>> Connection queryConnection,
>>>>>>>
>>>>>>> Connection updateConnection,
>>>>>>>
>>>>>>> ArrayList newsroomPublishedStatuses)
>>>>>>>throws SQLException {
>>>>>>> ArrayList contentArea = publishDocumentType( 100,
>>>>>>>100, newsroomPublishedStatuses );
>>>>>>>
>>>>>>> if ( contentArea.size() == 0 ) {
>>>>>>> return null;
>>>>>>> }
>>>>>>>
>>>>>>> String whereClause =
>>>>>>>getPhotographyDetailWhereClause( queryConnection,
>>>>>>>contentArea );
>>>>>>> String query = "SELECT sequenceId, photographyId,
>>>>>>>description, unSelectedThumbnailImage,
>>>>>>>selectedThumbnailImage, largeImage,
>>>>>
>>>>>highResolutionImage,
>>>>>
>>>>>
>>>>>
>>>>>>>sortOrder, createDate, lastUpdatedBy, modifiedDate
>>>
>>>FROM
>>>
>>>
>>>>>>>newsroomPhotographyCollectionDetail " + whereClause;
>>>>>>>
>>>>>>> Statement queryStmt =
>>>>>>>queryConnection.createStatement();
>>>>>>> StringBuffer insertStmt = new StringBuffer
>>>>>>>( 512 );
>>>>>>>
>>>>>>> insertStmt.append( "INSERT INTO
>>>>>>>newsroomPhotographyCollectionDetail (" );
>>>>>>> insertStmt.append( "sequenceId,"
>>>>>>> );
>>>>>>> insertStmt.append( "photographyId,"
>>>>>>> );
>>>>>>> insertStmt.append( "description,"
>>>>>>> );
>>>>>>> insertStmt.append(
>>>>>>> "unSelectedThumbnailImage," );
>>>>>>> insertStmt.append(
>>>>>>> "selectedThumbnailImage," );
>>>>>>> insertStmt.append( "largeImage,"
>>>>>>> );
>>>>>>> insertStmt.append(
>>>>>>> "highResolutionImage," );
>>>>>>> insertStmt.append( "sortOrder,"
>>>>>>> );
>>>>>>> insertStmt.append( "createDate,"
>>>>>>> );
>>>>>>> insertStmt.append( "lastUpdatedBy,"
>>>>>>> );
>>>>>>> insertStmt.append( "modifiedDate"
>>>>>>> );
>>>>>>> insertStmt.append( ") VALUES ("
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?,"
>>>>>>> );
>>>>>>> insertStmt.append( "?"
>>>>>>> );
>>>>>>> insertStmt.append( ")"
>>>>>>> );
>>>>>>>
>>>>>>> PreparedStatement pstmt = null;
>>>>>>> ResultSet rs = queryStmt.executeQuery( query );
>>>>>>>
>>>>>>> if ( rs.next() ) {
>>>>>>> updateStmt.addBatch( "DELETE FROM
>>>>>>>newsroomPhotographyCollectionDetail " +
>
> whereClause );
>
>>>>>>> pstmt = updateConnection.prepareStatement(
>>>>>>>insertStmt.toString() );
>>>>>>>
>>>>>>> do {
>>>>>>> pstmt.setInt(
>>>>>>> 1, rs.getInt( 1 ) );
>>>>>>> pstmt.setInt(
>>>>>>> 2, rs.getInt( 2 ) );
>>>>>>> pstmt.setString(
>>>>>>> 3, rs.getString( 3 ) );
>>>>>>>
>>>>>>> addImageToPreparedStatement(
>>>>>>>4, rs.getBytes( 4 ), pstmt );
>>>>>>> addImageToPreparedStatement(
>>>>>>>5, rs.getBytes( 5 ), pstmt );
>>>>>>> addImageToPreparedStatement(
>>>>>>>6, rs.getBytes( 6 ), pstmt );
>>>>>>> addImageToPreparedStatement(
>>>>>>>7, rs.getBytes( 7 ), pstmt );
>>>>>>>
>>>>>>> pstmt.setInt(
>>>>>>> 8, rs.getInt( 8 ) );
>>>>>>> pstmt.setTimestamp(
>>>>>>> 9, rs.getTimestamp( 9 ) );
>>>>>>> pstmt.setString(
>>>>>>> 10, rs.getString( 10 ) );
>>>>>>> pstmt.setTimestamp(
>>>>>>> 11, rs.getTimestamp(11 ) );
>>>>>>>
>>>>>>> pstmt.addBatch();
>>>>>>> } while ( rs.next() );
>>>>>>> }
>>>>>>> queryStmt.close();
>>>>>>> return pstmt;
>>>>>>>}
>>>>>>>
>>>>>>>private void addImageToPreparedStatement(int outPos,
>>>>>
>>>>>byte
>>>>>
>>>>>
>>>>>
>>>>>>>[] image, PreparedStatement pstmt) throws
>
> SQLException
>
>>>{
>>>
>>>
>>>>>>> pstmt.setBinaryStream( outPos, new
>>>>>>>ByteArrayInputStream( image ), image.length );
>>>>>>>}
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>-----Original Message-----
>>>>>>>>
>>>>>>>>
>>>>>>>>Sam Lebron wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>Current technology used - I'm using the latest
>>>>>>>
>>>>>>>microsoft
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>jdbc driver, windows 2000 server, SQLServer
>>>
>>>enterprise
>>>
>>>
>>>>>>>>>edition, weblogic running jvm version 1.3.
>>>>>>>>>
>>>>>>>>>What I'm trying to do - I'm using a Statement
>
> object
>
>>>>>>>>>to "select *" from a table that contains 64 rows,
>>>
>>>four
>>>
>>>
>>>>>>>>>image attributes per row, over 111 megabytes of
>>>
>>>total
>>>
>>>
>>>>>>>data.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>Problem - ResultSet.next() was true, I read 3 out
>
> of
>
>>>>>>>the
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>four images and the fourth once was null. That
>>>>>>>
>>>>>>>attribute
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>on that row has data.
>>>>>>>>>
>>>>>>>>>I currently rewrote the code to grab only the
>>>
>>>changed
>>>
>>>
>>>>>>>>>sections and it's working for now.
>>>>>>>>>
>>>>>>>>>Is there any limitation on the
>>>>>>>
>>>>>>>driver/connection/statement
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>that would cause the resultset to get truncated?
>>>>>>>>>
>>>>>>>>>I could not find any SQLServer settings that would
>>>>>>>
>>>>>>>affect
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>this.
>>>>>>>>>
>>>>>>>>>I'm using the default connection and statement
>>>>>
>>>>>settings.
>>>>>
>>>>>
>>>>>
>>>>>>>>I don't think so. Can you reproduce the problem
>>>
>>>running
>>>
>>>
>>>>>>>the
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>same query using the same driver in a little
>>>
>>>standalone
>>>
>>>
>>>>>>>>program? I assume you are reading the rows in the
>>>
>>>order
>>>
>>>
>>>>>>>>they come from the query, correct? There is a
>
> driver
>
>>>>>>>limitation
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>that for text/image types, yo do have to read the
>>>
>>>data
>>>
>>>
>>>>>in
>>>>>
>>>>>
>>>>>
>>>>>>>>returned order...
>>>>>>>>Joe Weinstein at BEA
>>>>>>>>
>>>>>>>>.
>>>>>>>>
>>>>>>
>>>>>>.
>>>>>>
>>>>
>>>>.
>>>>
>>
>>.
>>
- Previous message: Sam Lebron: "Re: ResultSet size limitation"
- In reply to: Sam Lebron: "Re: ResultSet size limitation"
- Next in thread: Sam Lebron: "Re: ResultSet size limitation"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|