Home » U++ Library support » U++ SQL » OkCommit problem
OkCommit problem [message #5134] |
Wed, 06 September 2006 18:53 |
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;
}
|
|
|
Goto Forum:
Current Time: Tue May 14 19:58:47 CEST 2024
Total time taken to generate the page: 0.03291 seconds
|