Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » OkCommit problem
OkCommit problem [message #5134] Wed, 06 September 2006 18:53 Go to previous message
zsolt is currently offline  zsolt
Messages: 698
Registered: December 2005
Location: Budapest, Hungary
Contributor
The problem is this method:
bool OkCommit(SqlSession& session, const char *msg) {
	if(ErrorRollback(session, msg))
		return false;
	session.Commit();
	return true;
}


In the case of unsuccessful commit, nothing happens. This way it is very hard to detect the problem, because the next execution generates an error.

So I changed the method to this:

bool OkCommit(SqlSession& session, const char *msg) {
	if(ErrorRollback(session, msg))
		return false;
	do{
		session.Commit();
		if(!session.WasError())
		{
			session.ClearError();
			return true;
		}
	}while(IDRETRY==SqlError(t_("Unable to commit changes to database."), session, true));		
	return false;
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Can I create DBF files?
Next Topic: MySqlSession::EnumTables -> why uppercase?
Goto Forum:
  


Current Time: Tue May 14 19:58:47 CEST 2024

Total time taken to generate the page: 0.03291 seconds