U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ SQL » questions about sqlArray
Re: questions about sqlArray [message #35410 is a reply to message #35409] Fri, 10 February 2012 18:59 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
BioBytes wrote on Fri, 10 February 2012 12:26

Hi papascalientes,

Mirek has given very good explanations as usual. Sure SqlArray can do some actions "magically" but cannot solve all your problems of errors that could happen in code. It is the way I go in my own applications.

The update, insert and delete operations are managed by SqlCtrls and generally, my application menu functions are written on the following basis:

void MainWin::DefineDevices()
{
	SQL.Begin();

	DevicesDlgWin.FillList(); 
        //Initialization of ctrls in the dialog window
	
	if(DevicesDlgWin.ExecuteOK())SQL.Commit();
	else SQL.Rollback();
}


So if the user presses ok (validation) button, the transaction is committed. If cancel button is pressed, modifications are not recorded in database.

Biobytes


BTW, this a bad practice. You should not use transactions whose length depends on user GUI interaction. Transactions should be short.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CLOB data handling
Next Topic: Is it possible to call a stored procedure with an output parameter?
Goto Forum:
  


Current Time: Sat Oct 03 08:11:12 GMT+2 2026

Total time taken to generate the page: 0.00927 seconds