Re: ResultSet size limitation

From: Joe Weinstein (joeNOSPAM_at_bea.com)
Date: 04/07/04

  • Next message: Frank Brouwer: "Re: Simple Connection Pooling Example from JAVA needed"
    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
    >>>>>>>>
    >>>>>>>>.
    >>>>>>>>
    >>>>>>
    >>>>>>.
    >>>>>>
    >>>>
    >>>>.
    >>>>
    >>
    >>.
    >>


  • Next message: Frank Brouwer: "Re: Simple Connection Pooling Example from JAVA needed"

    Relevant Pages

    • cvs-src summary for June 14-21
      ... Intel PRO/10GbE driver MFC'ed ... Max responded, saying that since the script only adds lines to the output, ... Max later backed out the commit. ... Bruce Evans fixed a bug that allowed users to crash the system by ...
      (freebsd-current)
    • cvs-src summary for May 31 - June 7
      ... You can get old summaries, and an HTML version of this one, at ... driver for Intel Ethernet cards, then the ndis driver, for emulation of ... Maxime Henrion changed the fxp driver to use the device sysctl tree, ... This bug is covered by `FreeBSD-SA-04:12.jailroute`_, ...
      (freebsd-current)
    • cvs-src summary for May 24-31
      ... Tony Ackerman committed the first release of the ixgb driver, ... Brooks Davis added support for a /etc/eui64 file, ... Oliver Eikemeier added a "-depth n" flag to find. ... Dag-Erling Smorgrav fixed a bug in the msync system call that permitted ...
      (freebsd-current)
    • cvs-src summary for January 4-10
      ... It is intended to help the FreeBSD community keep up with the fast-paced ... driver, for PS/2 mice. ... Ceri Davies is now a src committer, ... Important Bug Fixes ...
      (freebsd-current)
    • Re: MSI RS482M4-ILD (Radeon Xpress 200 chipset)
      ... It must be a KDE bug. ... Nvidia doesn't have a large presence). ... cards and network cards? ... much easier to report or even fix bugs myself in an opensource driver. ...
      (comp.os.linux.hardware)

  • Quantcast