Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WCTDatabase不能回滚 #69

Closed
zhuangyz opened this issue Jun 22, 2017 · 1 comment
Closed

WCTDatabase不能回滚 #69

zhuangyz opened this issue Jun 22, 2017 · 1 comment
Assignees
Labels

Comments

@zhuangyz
Copy link

在sample_transaction_main.mm里
[database runTransaction:^BOOL {
WCTSampleTransaction *object = [[WCTSampleTransaction alloc] init];
object.intValue = 5;
BOOL ret = [database insertObject:object into:tableName];
//return YES to do a commit and return NO to do a rollback
return NO; // 这里强制return NO,但上面的insert操作依然生效
} event:nil];

在database_transaction.cpp里
bool Database::rollback(Error &error)
{
......
result = CoreBase::exec(handle, StatementTransaction().commit(), error);
std::unordered_map<std::string, RecyclableHandle> *threadedHandle =
[s_threadedHandle.get();]
......
}
这里的StatementTransaction().commit()是否应该是StatementTransaction().rollback()

@RingoD RingoD self-assigned this Jun 22, 2017
@RingoD
Copy link
Collaborator

RingoD commented Jun 22, 2017

抱歉,这里是误传了测试代码,已经fix了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants