Issue 62646 - Basic debug hangs on accessing row
Summary: Basic debug hangs on accessing row
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 2.0.1
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: OOo 2.0.3
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords: needmoreinfo
Depends on:
Blocks:
 
Reported: 2006-02-28 15:38 UTC by rnhainsworth
Modified: 2006-06-02 13:37 UTC (History)
1 user (show)

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


Attachments
bugdoc database (4.01 KB, application/vnd.sun.xml.base)
2006-04-24 15:01 UTC, marc.neumann
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description rnhainsworth 2006-02-28 15:38:54 UTC
OO hangs when I try to inpect a variable in the IDE during run time.

The code is as follows and the Subroutine works, taking data from a database,
placing it in a combobox on a dialog and starting the dialog. But ...

Sub SetBankDialog
Dim mDialog as object
'get the dialog from the library
 mDialog = DialogLibraries.getByName( "Standard" ).getByName( "DlgViewBanks" )
 odialog = CreateUnoDialog(mDialog)

'get the RegN needed for the dropdown list of RegNs
	oDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
	If oDBContext.HasbyName(DSName) Then
		oConnection = oDBContext.GetByName(DSName).GetConnection("richard","123")
	Else
		Msgbox("DataSource " & DSName & " is not registered" , 16,"IT")
		Exit Sub
	End If
	sql= "select ""RegN"" from """ & MetaTable & """ where ""Operating""=true" 
	RowRes = oConnection.createStatement.executeQuery(sql)
	'put the data into the fields
	olist = odialog.getControl("RegNList")
	while RowRes.next
		count = olist.getItemCount()
		olist.addItem(RowRes.getInt(1),count)
	wend
	' now put the finished dialog onto the screen
	odialog.execute
End Sub

In order to develop the code later, I want to see what is in RowRes. If I put a
break point immediately after RowRes, put a watch on RowRes, everything is fine.
But when I try to 'open' RowRes, the whole of OO relaunches.

It only happens when accessing a database, hence I have allocated this bug here.

Richard
Comment 1 christoph.lukasiak 2006-03-08 14:38:54 UTC
clu->fs: maybe you know, what to do with this - do we support code debugging?
Comment 2 marc.neumann 2006-03-08 14:43:01 UTC
reassign to msc to have a look
Comment 3 marc.neumann 2006-03-10 10:11:57 UTC
Hi,

I can't reproduce this, so I have some questions.

1. what kind of database do you use ( hsql, JDBC, ODBC, MySQL, ...)
2. Does the same problem occure if you use the "Bibliography" database as
DSName. And  change the sql string to a simple "select * from biblio"
3. does the crashreporter occur when you restart the office and have you send a
crash report?

Bye Marc



Comment 4 rnhainsworth 2006-03-12 07:09:32 UTC
Agreed - biblio does not crash.

I used both mysql and postgres databases. The mysql database was set up on my
local machine and on a network, the postgres only on the network. Same behaviour
in each case.

The mysql connection was via ODBC.

The driver for the postgres was installed according to the instructions on the
openoffice site.

Both connections work and tables can be accessed via oo database files.

I only reported this as a bug after I changed from using mysql to postgres, as I
thought that had eliminated the driver as the problem source.

For some reason the crash is not generating a crash report. There is an
automatic relaunch of OO2 and recovery of the files open at the time of the
crash. However, the 'next' button to open the crash report tool is not on the
final dialog. I could not quickly see how to activate the crash report tool.

The select statement is not material to the problem. "select * from mytable"
produces a crash, just as the more complex select given below.

The following is a simpler test. When Bibliography (and table biblio) are used,
no crash. When RRatingBase ("Bank") are used, there is a crash. I emphasis: the
code works as part of a more general application. So here, a message box with
'Got Data' appears. But when I try to use the debugger and access 'ResRows'
after it has been obtained, there is a crash.

Sub Main
	Dim oDBContext as Object, oConnection as Object, ResRows as Object
REM	Const DSName = "Bibliography"
	Const DSName = "RRatingBase"
	oDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
	If oDBContext.HasbyName(DSName) Then
REM		oConnection = oDBContext.GetByName(DSName).GetConnection("dummy","dummy")
		oConnection = oDBContext.GetByName(DSName).GetConnection("richard","123")
	Else
		Msgbox("DataSource " & DSName & " is not registered")
		Exit Sub
	End If
	
REM	ResRows = oConnection.createStatement.executeQuery("select * from biblio")
	ResRows = oConnection.createStatement.executeQuery("select * from ""Bank""")
	if ResRows.next Then
		MsgBox("Got data")
	Else
		MsgBox("Not got data")
	End If
x=0 ' breakpoint set on this stub line
End Sub
Comment 5 marc.neumann 2006-03-13 12:11:25 UTC
Hi,

I can reproduce this with the postgres sdbc driver from dba.openoffice.org.

I reassign it to the right developer and set target.

msc -> fs: please have a look if this is a basic debugger bug or a database bug.

Bye Marc
Comment 6 Frank Schönheit 2006-03-13 12:23:50 UTC
fs->ab: SbUnoObj::Notify is on the stack ... (search the report mail tool for
this issue's id (i62646))
Comment 7 ab 2006-04-24 09:34:10 UTC
ab->msc: I could not reproduce this as sample code cannot be executed without
a registered database "RRatingBase". The stack doesn't show anything. How
did you manage to reproduce it? Could you provide a bugdoc? If this task only
can be reproduced using this special "postgres sdbc driver" it doesn't look like
a Basic problem anyway.
Comment 8 marc.neumann 2006-04-24 14:59:48 UTC
hi,

This only happend with the postgres sdbc driver.

The driver can be downloaded here
http://dba.openoffice.org/drivers/postgresql/postgresql-sdbc-0.7.0.zip

and installed with 
unopkg add /path/to/your/download/postgresql-sdbc-0.7.0.zip

Then register rthe attached bugdoc database as postgres_local_sdb via tools /
options / database / database 
Then execute the script
Sub Main
	Dim oDBContext as Object, oConnection as Object, ResRows as Object

	oDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")	
	oConnection =
oDBContext.GetByName("postgres_local_sdb").GetConnection("pgsqluser","")	
	ResRows = oConnection.createStatement.executeQuery("select * from ""Table1""")
	if ResRows.next Then
		MsgBox("Got data")
	Else
		MsgBox("Not got data")
	End If
x=0 ' breakpoint set on this stub line
End Sub




Comment 9 marc.neumann 2006-04-24 15:01:11 UTC
Created attachment 35987 [details]
bugdoc database
Comment 10 ab 2006-04-24 15:09:48 UTC
ab->fs: Nothing is impossible, but I cannot imagine how a Basic bug should
depend from a special database driver. Of course I could have a look anyway,
but this won't be possible for 2.0.3. If you consider this to be very important,
please have a look.
Comment 11 Frank Schönheit 2006-04-25 09:43:18 UTC
the stack report was telling nonsense ... In fact, the crash was in DBA code.

Fixed in CWS dba203c.
Comment 12 Frank Schönheit 2006-04-27 13:29:52 UTC
fs-> msc: please verify in CWS dba203c

re-open issue and reassign to msc
Comment 13 Frank Schönheit 2006-04-27 13:29:56 UTC
reassign to msc
Comment 14 Frank Schönheit 2006-04-27 13:30:00 UTC
reset resolution to FIXED
Comment 15 marc.neumann 2006-04-27 13:54:00 UTC
verified in cws dba203c

You can found more information about this CWS in the EIS tool at
http://eis.services.openoffice.org/EIS2/cws.SearchCWS
Comment 16 marc.neumann 2006-06-02 13:37:00 UTC
Hi,

this is fixed in the current master. The current master is available at
http://download.openoffice.org/680/index.html

I close this issue now.

Bye Marc