Issue 14237 - A resultset should hold the creator statement alive
Summary: A resultset should hold the creator statement alive
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.1
Hardware: All Other OS
: P4 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: Frank Schönheit
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-08 10:57 UTC by ocke.janssen
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ocke.janssen 2003-05-08 10:57:16 UTC
Suppose follwing code,

ResultSet createResult()
{
   Statement stmt = con.createStatement();
   return stmt.executeQeury("...");
}

In the current implementation the resultset will bve invalid because the
statement will be destroxed and the end of scope. But this a common use for
resultset creation and should be changed.
Comment 1 ocke.janssen 2003-05-08 10:58:16 UTC
changed to OO2.0
Comment 2 hans_werner67 2004-02-02 12:53:35 UTC
change subcomponent to 'none'
Comment 3 ocke.janssen 2004-02-10 13:48:34 UTC
.
Comment 4 ocke.janssen 2004-03-06 16:00:18 UTC
Fixed in cws insight01.
Comment 5 marc.neumann 2004-06-16 12:52:50 UTC
reopen
Comment 6 marc.neumann 2004-06-16 12:54:13 UTC
reassign to fs
Comment 7 marc.neumann 2004-06-16 12:55:25 UTC
is issue is fixed in cws insight01 , can you please verify this.

Thanks Marc
Comment 8 Frank Schönheit 2004-06-17 12:54:17 UTC
verified in CWS insight01 with the following macro:
Sub Main
	oContext = createUnoService( "com.sun.star.sdb.DatabaseContext" )
	oDataSource = oContext.getByName( "Bibliography" )
	oConnection = oDataSource.getConnection( "", "" )

	oStatement = oConnection.createStatement( )
	oResultSet = oStatement.executeQuery( "SELECT * FROM biblio" )

	' just to release the reference to the statement which just created  the result set
	oStatement = oConnection.createStatement

	oColumn = oResultSet.getColumns().getByName( "Identifier" )
	Dim sIdents as String
	While ( oResultSet.next() )
		sIdents = sIdents + oColumn.getString() + chr(13)
	Wend
	MsgBox sIdents

	oConnection.dispose
End Sub
Comment 9 Frank Schönheit 2004-12-30 08:41:10 UTC
fix verified in 680 m66