Apache OpenOffice (AOO) Bugzilla – Issue 62646
Basic debug hangs on accessing row
Last modified: 2006-06-02 13:37:00 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
clu->fs: maybe you know, what to do with this - do we support code debugging?
reassign to msc to have a look
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
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
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
fs->ab: SbUnoObj::Notify is on the stack ... (search the report mail tool for this issue's id (i62646))
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.
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
Created attachment 35987 [details] bugdoc database
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.
the stack report was telling nonsense ... In fact, the crash was in DBA code. Fixed in CWS dba203c.
fs-> msc: please verify in CWS dba203c re-open issue and reassign to msc
reassign to msc
reset resolution to FIXED
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
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