To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=81074
                 Issue #|81074
                 Summary|XRowSetApproveListener approval of dataset change does
                        |n't save correctly to database
               Component|Word processor
                 Version|680m225
                Platform|All
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P2
            Subcomponent|editing
             Assigned to|cn
             Reported by|helgekraak





------- Additional comments from [EMAIL PROTECTED] Tue Aug 28 07:18:21 +0000 
2007 -------
If you want to avoid data loss of data entered in a form which is connected to a
HSQLDB Base document after Openoffice crashes this is the only code which avoids
this:

'Example Number 1
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(ThisComponent.CurrentController.Frame,
".uno:RecSave", "", 0, Array())

Form = thiscomponent.drawpage.forms.getByName("FormName")

Form.ActiveConnection.Flush
'--

Using just Form.ActiveConnection.Flush only avoids data loss when data was sent
to the database via SQL like (shortened):

'Example Number 2
oStatement = Connection.createStatement()
oStatement.executeUpdate(SQL-Statement)
'--

I tried using Example Number 1 after the approveRowChange = TRUE order when
using the XRowSetApproveListener but this ends in an endless loop of the routine
because of the RecSave dispatcher. When I just use Form.ActiveConnection.Flush
and kill soffice.bin the last record change is not in the database after restart
of Openoffice.

Conclusion: The XRowSetApproveListener needs to save data in the same way like
data is saved with the RecSave dispatcher.

PS: Please also note
http://www.oooforum.org/forum/viewtopic.phtml?t=43786&highlight=data+loss
There you will find the following attempts of avoiding data loss. I tried them
as a substitute of the RecSave dispatcher but they don't have any effect when
used together with Form.ActiveConnection.Flush.


Sub database_flush

DatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext")
DataSource = DatabaseContext.getByName("DatabaseName")
Connection = DataSource.GetConnection("SA","")

'1st attempt

DataSource.flush

'2nd attempt

Connection.flush

'3rd attempt

Statement = Connection.createStatement()

execute_sql = Statement.execute("CHECKPOINT")   
   
End Sub

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to