ObjSQLite3  Diff

Differences From Artifact [a891b7926a]:

To Artifact [dbf2ad6c36]:


86
87
88
89
90
91
92





















93
	int code = sqlite3_exec(_conn, SQL.UTF8String, NULL, NULL, NULL);

	if (code != SQLITE_OK)
		@throw [SL3ExecuteStatementFailedException
		    exceptionWithConnection: self
				  errorCode: code];
}





















@end







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
	int code = sqlite3_exec(_conn, SQL.UTF8String, NULL, NULL, NULL);

	if (code != SQLITE_OK)
		@throw [SL3ExecuteStatementFailedException
		    exceptionWithConnection: self
				  errorCode: code];
}

#ifdef OF_HAVE_BLOCKS
- (void)transactionWithBlock: (bool (^)(void))block
{
	bool commit;

	[self executeStatement: @"BEGIN TRANSACTION"];

	@try {
		commit = block();
	} @catch (id e) {
		[self executeStatement: @"ROLLBACK TRANSACTION"];
		@throw e;
	}

	if (commit)
		[self executeStatement: @"COMMIT TRANSACTION"];
	else
		[self executeStatement: @"ROLLBACK TRANSACTION"];
}
#endif
@end