FMDatabaseQueue.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>FMDatabaseQueue Class Reference</title>
  6. <link rel="stylesheet" href="../css/style.css">
  7. <meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
  8. <meta name="generator" content="appledoc 2.2.1 (build 1334)">
  9. </head>
  10. <body class="appledoc">
  11. <header>
  12. <div class="container" class="hide-in-xcode">
  13. <h1 id="library-title">
  14. <a href="../index.html">FMDB </a>
  15. </h1>
  16. <p id="developer-home">
  17. <a href="../index.html">ccgus</a>
  18. </p>
  19. </div>
  20. </header>
  21. <aside>
  22. <div class="container">
  23. <nav>
  24. <ul id="header-buttons" role="toolbar">
  25. <li><a href="../index.html">Index</a></li>
  26. <li><a href="../hierarchy.html">Hierarchy</a></li>
  27. <li id="on-this-page" role="navigation">
  28. <label>
  29. On This Page
  30. <div class="chevron">
  31. <div class="chevy chevron-left"></div>
  32. <div class="chevy chevron-right"></div>
  33. </div>
  34. <select id="jump-to">
  35. <option value="top">Jump To&#133;</option>
  36. <option value="overview">Overview</option>
  37. <option value="tasks">Tasks</option>
  38. <optgroup label="Properties">
  39. <option value="//api/name/openFlags">openFlags</option>
  40. <option value="//api/name/path">path</option>
  41. </optgroup>
  42. <optgroup label="Class Methods">
  43. <option value="//api/name/databaseClass">+ databaseClass</option>
  44. <option value="//api/name/databaseQueueWithPath:">+ databaseQueueWithPath:</option>
  45. <option value="//api/name/databaseQueueWithPath:flags:">+ databaseQueueWithPath:flags:</option>
  46. </optgroup>
  47. <optgroup label="Instance Methods">
  48. <option value="//api/name/close">- close</option>
  49. <option value="//api/name/inDatabase:">- inDatabase:</option>
  50. <option value="//api/name/inDeferredTransaction:">- inDeferredTransaction:</option>
  51. <option value="//api/name/inSavePoint:">- inSavePoint:</option>
  52. <option value="//api/name/inTransaction:">- inTransaction:</option>
  53. <option value="//api/name/initWithPath:">- initWithPath:</option>
  54. <option value="//api/name/initWithPath:flags:">- initWithPath:flags:</option>
  55. <option value="//api/name/initWithPath:flags:vfs:">- initWithPath:flags:vfs:</option>
  56. </optgroup>
  57. </select>
  58. </label>
  59. </li>
  60. </ul>
  61. </nav>
  62. </div>
  63. </aside>
  64. <article>
  65. <div id="overview_contents" class="container">
  66. <div id="content">
  67. <main role="main">
  68. <h1 class="title">FMDatabaseQueue Class Reference</h1>
  69. <div class="section section-specification"><table cellspacing="0"><tbody>
  70. <tr>
  71. <th>Inherits from</th>
  72. <td>NSObject</td>
  73. </tr><tr>
  74. <th>Declared in</th>
  75. <td>FMDatabaseQueue.h</td>
  76. </tr>
  77. </tbody></table></div>
  78. <div class="section section-overview">
  79. <a title="Overview" name="overview"></a>
  80. <h2 class="subtitle subtitle-overview">Overview</h2>
  81. <p>To perform queries and updates on multiple threads, you&rsquo;ll want to use <code>FMDatabaseQueue</code>.</p>
  82. <p>Using a single instance of <a href="../Classes/FMDatabase.html"><code>FMDatabase</code></a> from multiple threads at once is a bad idea. It has always been OK to make a <a href="../Classes/FMDatabase.html"><code>FMDatabase</code></a> object <em>per thread</em>. Just don&rsquo;t share a single instance across threads, and definitely not across multiple threads at the same time.</p>
  83. <p>Instead, use <code>FMDatabaseQueue</code>. Here&rsquo;s how to use it:</p>
  84. <p>First, make your queue.</p>
  85. <pre><code>FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath];
  86. </code></pre>
  87. <p>Then use it like so:</p>
  88. <pre><code>[queue inDatabase:^(FMDatabase *db) {
  89. [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:1]];
  90. [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:2]];
  91. [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:3]];
  92. FMResultSet *rs = [db executeQuery:@"select * from foo"];
  93. while ([rs next]) {
  94. //…
  95. }
  96. }];
  97. </code></pre>
  98. <p>An easy way to wrap things up in a transaction can be done like this:</p>
  99. <pre><code>[queue inTransaction:^(FMDatabase *db, BOOL *rollback) {
  100. [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:1]];
  101. [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:2]];
  102. [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:3]];
  103. if (whoopsSomethingWrongHappened) {
  104. *rollback = YES;
  105. return;
  106. }
  107. // etc…
  108. [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:4]];
  109. }];
  110. </code></pre>
  111. <p><code>FMDatabaseQueue</code> will run the blocks on a serialized queue (hence the name of the class). So if you call <code>FMDatabaseQueue</code>&rsquo;s methods from multiple threads at the same time, they will be executed in the order they are received. This way queries and updates won&rsquo;t step on each other&rsquo;s toes, and every one is happy.</p>
  112. <h3>See also</h3>
  113. <ul>
  114. <li><a href="../Classes/FMDatabase.html"><code>FMDatabase</code></a></li>
  115. </ul>
  116. <div class="warning"><p><strong>Warning:</strong> Do not instantiate a single <a href="../Classes/FMDatabase.html"><code>FMDatabase</code></a> object and use it across multiple threads. Use <code>FMDatabaseQueue</code> instead.</p></div><div class="warning"><p><strong>Warning:</strong> The calls to <code>FMDatabaseQueue</code>&rsquo;s methods are blocking. So even though you are passing along blocks, they will <strong>not</strong> be run on another thread.</p></div>
  117. </div>
  118. <div class="section section-tasks">
  119. <a title="Tasks" name="tasks"></a>
  120. <h2 class="task-title">Other Methods</h2>
  121. <div class="task-list">
  122. <div class="section-method">
  123. <a name="//api/name/path" title="path"></a>
  124. <h3 class="method-title"><code><a href="#//api/name/path">&nbsp;&nbsp;path</a></code>
  125. </h3>
  126. <div class="method-info">
  127. <div class="pointy-thing"></div>
  128. <div class="method-info-container">
  129. <div class="method-subsection brief-description">
  130. <p>Path of database</p>
  131. </div>
  132. <div class="method-subsection method-declaration"><code>@property (atomic, retain) NSString *path</code></div>
  133. <div class="method-subsection discussion-section">
  134. <h4 class="method-subtitle">Discussion</h4>
  135. <p>Path of database</p>
  136. </div>
  137. <div class="method-subsection declared-in-section">
  138. <h4 class="method-subtitle">Declared In</h4>
  139. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  140. </div>
  141. </div>
  142. </div>
  143. </div><div class="section-method">
  144. <a name="//api/name/openFlags" title="openFlags"></a>
  145. <h3 class="method-title"><code><a href="#//api/name/openFlags">&nbsp;&nbsp;openFlags</a></code>
  146. </h3>
  147. <div class="method-info">
  148. <div class="pointy-thing"></div>
  149. <div class="method-info-container">
  150. <div class="method-subsection brief-description">
  151. <p>Open flags</p>
  152. </div>
  153. <div class="method-subsection method-declaration"><code>@property (atomic, readonly) int openFlags</code></div>
  154. <div class="method-subsection discussion-section">
  155. <h4 class="method-subtitle">Discussion</h4>
  156. <p>Open flags</p>
  157. </div>
  158. <div class="method-subsection declared-in-section">
  159. <h4 class="method-subtitle">Declared In</h4>
  160. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <a title="Initialization, opening, and closing of queue" name="task_Initialization, opening, and closing of queue"></a>
  167. <h2 class="task-title">Initialization, opening, and closing of queue</h2>
  168. <div class="task-list">
  169. <div class="section-method">
  170. <a name="//api/name/databaseQueueWithPath:" title="databaseQueueWithPath:"></a>
  171. <h3 class="method-title"><code><a href="#//api/name/databaseQueueWithPath:">+&nbsp;databaseQueueWithPath:</a></code>
  172. </h3>
  173. <div class="method-info">
  174. <div class="pointy-thing"></div>
  175. <div class="method-info-container">
  176. <div class="method-subsection brief-description">
  177. <p>Create queue using path.</p>
  178. </div>
  179. <div class="method-subsection method-declaration"><code>+ (instancetype)databaseQueueWithPath:(NSString *)<em>aPath</em></code></div>
  180. <div class="method-subsection arguments-section parameters">
  181. <h4 class="method-subtitle parameter-title">Parameters</h4>
  182. <table class="argument-def parameter-def">
  183. <tr>
  184. <th scope="row" class="argument-name"><code>aPath</code></th>
  185. <td><p>The file path of the database.</p></td>
  186. </tr>
  187. </table>
  188. </div>
  189. <div class="method-subsection return">
  190. <h4 class="method-subtitle parameter-title">Return Value</h4>
  191. <p>The <code>FMDatabaseQueue</code> object. <code>nil</code> on error.</p>
  192. </div>
  193. <div class="method-subsection discussion-section">
  194. <h4 class="method-subtitle">Discussion</h4>
  195. <p>Create queue using path.</p>
  196. </div>
  197. <div class="method-subsection declared-in-section">
  198. <h4 class="method-subtitle">Declared In</h4>
  199. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  200. </div>
  201. </div>
  202. </div>
  203. </div><div class="section-method">
  204. <a name="//api/name/databaseQueueWithPath:flags:" title="databaseQueueWithPath:flags:"></a>
  205. <h3 class="method-title"><code><a href="#//api/name/databaseQueueWithPath:flags:">+&nbsp;databaseQueueWithPath:flags:</a></code>
  206. </h3>
  207. <div class="method-info">
  208. <div class="pointy-thing"></div>
  209. <div class="method-info-container">
  210. <div class="method-subsection brief-description">
  211. <p>Create queue using path and specified flags.</p>
  212. </div>
  213. <div class="method-subsection method-declaration"><code>+ (instancetype)databaseQueueWithPath:(NSString *)<em>aPath</em> flags:(int)<em>openFlags</em></code></div>
  214. <div class="method-subsection arguments-section parameters">
  215. <h4 class="method-subtitle parameter-title">Parameters</h4>
  216. <table class="argument-def parameter-def">
  217. <tr>
  218. <th scope="row" class="argument-name"><code>aPath</code></th>
  219. <td><p>The file path of the database.</p></td>
  220. </tr>
  221. <tr>
  222. <th scope="row" class="argument-name"><code>openFlags</code></th>
  223. <td><p>Flags passed to the openWithFlags method of the database</p></td>
  224. </tr>
  225. </table>
  226. </div>
  227. <div class="method-subsection return">
  228. <h4 class="method-subtitle parameter-title">Return Value</h4>
  229. <p>The <code>FMDatabaseQueue</code> object. <code>nil</code> on error.</p>
  230. </div>
  231. <div class="method-subsection discussion-section">
  232. <h4 class="method-subtitle">Discussion</h4>
  233. <p>Create queue using path and specified flags.</p>
  234. </div>
  235. <div class="method-subsection declared-in-section">
  236. <h4 class="method-subtitle">Declared In</h4>
  237. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  238. </div>
  239. </div>
  240. </div>
  241. </div><div class="section-method">
  242. <a name="//api/name/initWithPath:" title="initWithPath:"></a>
  243. <h3 class="method-title"><code><a href="#//api/name/initWithPath:">&ndash;&nbsp;initWithPath:</a></code>
  244. </h3>
  245. <div class="method-info">
  246. <div class="pointy-thing"></div>
  247. <div class="method-info-container">
  248. <div class="method-subsection brief-description">
  249. <p>Create queue using path.</p>
  250. </div>
  251. <div class="method-subsection method-declaration"><code>- (instancetype)initWithPath:(NSString *)<em>aPath</em></code></div>
  252. <div class="method-subsection arguments-section parameters">
  253. <h4 class="method-subtitle parameter-title">Parameters</h4>
  254. <table class="argument-def parameter-def">
  255. <tr>
  256. <th scope="row" class="argument-name"><code>aPath</code></th>
  257. <td><p>The file path of the database.</p></td>
  258. </tr>
  259. </table>
  260. </div>
  261. <div class="method-subsection return">
  262. <h4 class="method-subtitle parameter-title">Return Value</h4>
  263. <p>The <code>FMDatabaseQueue</code> object. <code>nil</code> on error.</p>
  264. </div>
  265. <div class="method-subsection discussion-section">
  266. <h4 class="method-subtitle">Discussion</h4>
  267. <p>Create queue using path.</p>
  268. </div>
  269. <div class="method-subsection declared-in-section">
  270. <h4 class="method-subtitle">Declared In</h4>
  271. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  272. </div>
  273. </div>
  274. </div>
  275. </div><div class="section-method">
  276. <a name="//api/name/initWithPath:flags:" title="initWithPath:flags:"></a>
  277. <h3 class="method-title"><code><a href="#//api/name/initWithPath:flags:">&ndash;&nbsp;initWithPath:flags:</a></code>
  278. </h3>
  279. <div class="method-info">
  280. <div class="pointy-thing"></div>
  281. <div class="method-info-container">
  282. <div class="method-subsection brief-description">
  283. <p>Create queue using path and specified flags.</p>
  284. </div>
  285. <div class="method-subsection method-declaration"><code>- (instancetype)initWithPath:(NSString *)<em>aPath</em> flags:(int)<em>openFlags</em></code></div>
  286. <div class="method-subsection arguments-section parameters">
  287. <h4 class="method-subtitle parameter-title">Parameters</h4>
  288. <table class="argument-def parameter-def">
  289. <tr>
  290. <th scope="row" class="argument-name"><code>aPath</code></th>
  291. <td><p>The file path of the database.</p></td>
  292. </tr>
  293. <tr>
  294. <th scope="row" class="argument-name"><code>openFlags</code></th>
  295. <td><p>Flags passed to the openWithFlags method of the database</p></td>
  296. </tr>
  297. </table>
  298. </div>
  299. <div class="method-subsection return">
  300. <h4 class="method-subtitle parameter-title">Return Value</h4>
  301. <p>The <code>FMDatabaseQueue</code> object. <code>nil</code> on error.</p>
  302. </div>
  303. <div class="method-subsection discussion-section">
  304. <h4 class="method-subtitle">Discussion</h4>
  305. <p>Create queue using path and specified flags.</p>
  306. </div>
  307. <div class="method-subsection declared-in-section">
  308. <h4 class="method-subtitle">Declared In</h4>
  309. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  310. </div>
  311. </div>
  312. </div>
  313. </div><div class="section-method">
  314. <a name="//api/name/initWithPath:flags:vfs:" title="initWithPath:flags:vfs:"></a>
  315. <h3 class="method-title"><code><a href="#//api/name/initWithPath:flags:vfs:">&ndash;&nbsp;initWithPath:flags:vfs:</a></code>
  316. </h3>
  317. <div class="method-info">
  318. <div class="pointy-thing"></div>
  319. <div class="method-info-container">
  320. <div class="method-subsection brief-description">
  321. <p>Create queue using path and specified flags.</p>
  322. </div>
  323. <div class="method-subsection method-declaration"><code>- (instancetype)initWithPath:(NSString *)<em>aPath</em> flags:(int)<em>openFlags</em> vfs:(NSString *)<em>vfsName</em></code></div>
  324. <div class="method-subsection arguments-section parameters">
  325. <h4 class="method-subtitle parameter-title">Parameters</h4>
  326. <table class="argument-def parameter-def">
  327. <tr>
  328. <th scope="row" class="argument-name"><code>aPath</code></th>
  329. <td><p>The file path of the database.</p></td>
  330. </tr>
  331. <tr>
  332. <th scope="row" class="argument-name"><code>openFlags</code></th>
  333. <td><p>Flags passed to the openWithFlags method of the database</p></td>
  334. </tr>
  335. <tr>
  336. <th scope="row" class="argument-name"><code>vfsName</code></th>
  337. <td><p>The name of a custom virtual file system</p></td>
  338. </tr>
  339. </table>
  340. </div>
  341. <div class="method-subsection return">
  342. <h4 class="method-subtitle parameter-title">Return Value</h4>
  343. <p>The <code>FMDatabaseQueue</code> object. <code>nil</code> on error.</p>
  344. </div>
  345. <div class="method-subsection discussion-section">
  346. <h4 class="method-subtitle">Discussion</h4>
  347. <p>Create queue using path and specified flags.</p>
  348. </div>
  349. <div class="method-subsection declared-in-section">
  350. <h4 class="method-subtitle">Declared In</h4>
  351. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  352. </div>
  353. </div>
  354. </div>
  355. </div><div class="section-method">
  356. <a name="//api/name/databaseClass" title="databaseClass"></a>
  357. <h3 class="method-title"><code><a href="#//api/name/databaseClass">+&nbsp;databaseClass</a></code>
  358. </h3>
  359. <div class="method-info">
  360. <div class="pointy-thing"></div>
  361. <div class="method-info-container">
  362. <div class="method-subsection brief-description">
  363. <p>Returns the Class of &lsquo;FMDatabase&rsquo; subclass, that will be used to instantiate database object.</p>
  364. </div>
  365. <div class="method-subsection method-declaration"><code>+ (Class)databaseClass</code></div>
  366. <div class="method-subsection return">
  367. <h4 class="method-subtitle parameter-title">Return Value</h4>
  368. <p>The Class of &lsquo;FMDatabase&rsquo; subclass, that will be used to instantiate database object.</p>
  369. </div>
  370. <div class="method-subsection discussion-section">
  371. <h4 class="method-subtitle">Discussion</h4>
  372. <p>Returns the Class of &lsquo;FMDatabase&rsquo; subclass, that will be used to instantiate database object.</p>
  373. <p>Subclasses can override this method to return specified Class of &lsquo;FMDatabase&rsquo; subclass.</p>
  374. </div>
  375. <div class="method-subsection declared-in-section">
  376. <h4 class="method-subtitle">Declared In</h4>
  377. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  378. </div>
  379. </div>
  380. </div>
  381. </div><div class="section-method">
  382. <a name="//api/name/close" title="close"></a>
  383. <h3 class="method-title"><code><a href="#//api/name/close">&ndash;&nbsp;close</a></code>
  384. </h3>
  385. <div class="method-info">
  386. <div class="pointy-thing"></div>
  387. <div class="method-info-container">
  388. <div class="method-subsection brief-description">
  389. <p>Close database used by queue.</p>
  390. </div>
  391. <div class="method-subsection method-declaration"><code>- (void)close</code></div>
  392. <div class="method-subsection discussion-section">
  393. <h4 class="method-subtitle">Discussion</h4>
  394. <p>Close database used by queue.</p>
  395. </div>
  396. <div class="method-subsection declared-in-section">
  397. <h4 class="method-subtitle">Declared In</h4>
  398. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  399. </div>
  400. </div>
  401. </div>
  402. </div>
  403. </div>
  404. <a title="Dispatching database operations to queue" name="task_Dispatching database operations to queue"></a>
  405. <h2 class="task-title">Dispatching database operations to queue</h2>
  406. <div class="task-list">
  407. <div class="section-method">
  408. <a name="//api/name/inDatabase:" title="inDatabase:"></a>
  409. <h3 class="method-title"><code><a href="#//api/name/inDatabase:">&ndash;&nbsp;inDatabase:</a></code>
  410. </h3>
  411. <div class="method-info">
  412. <div class="pointy-thing"></div>
  413. <div class="method-info-container">
  414. <div class="method-subsection brief-description">
  415. <p>Synchronously perform database operations on queue.</p>
  416. </div>
  417. <div class="method-subsection method-declaration"><code>- (void)inDatabase:(void ( ^ ) ( FMDatabase *db ))<em>block</em></code></div>
  418. <div class="method-subsection arguments-section parameters">
  419. <h4 class="method-subtitle parameter-title">Parameters</h4>
  420. <table class="argument-def parameter-def">
  421. <tr>
  422. <th scope="row" class="argument-name"><code>block</code></th>
  423. <td><p>The code to be run on the queue of <code>FMDatabaseQueue</code></p></td>
  424. </tr>
  425. </table>
  426. </div>
  427. <div class="method-subsection discussion-section">
  428. <h4 class="method-subtitle">Discussion</h4>
  429. <p>Synchronously perform database operations on queue.</p>
  430. </div>
  431. <div class="method-subsection declared-in-section">
  432. <h4 class="method-subtitle">Declared In</h4>
  433. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  434. </div>
  435. </div>
  436. </div>
  437. </div><div class="section-method">
  438. <a name="//api/name/inTransaction:" title="inTransaction:"></a>
  439. <h3 class="method-title"><code><a href="#//api/name/inTransaction:">&ndash;&nbsp;inTransaction:</a></code>
  440. </h3>
  441. <div class="method-info">
  442. <div class="pointy-thing"></div>
  443. <div class="method-info-container">
  444. <div class="method-subsection brief-description">
  445. <p>Synchronously perform database operations on queue, using transactions.</p>
  446. </div>
  447. <div class="method-subsection method-declaration"><code>- (void)inTransaction:(void ( ^ ) ( FMDatabase *db , BOOL *rollback ))<em>block</em></code></div>
  448. <div class="method-subsection arguments-section parameters">
  449. <h4 class="method-subtitle parameter-title">Parameters</h4>
  450. <table class="argument-def parameter-def">
  451. <tr>
  452. <th scope="row" class="argument-name"><code>block</code></th>
  453. <td><p>The code to be run on the queue of <code>FMDatabaseQueue</code></p></td>
  454. </tr>
  455. </table>
  456. </div>
  457. <div class="method-subsection discussion-section">
  458. <h4 class="method-subtitle">Discussion</h4>
  459. <p>Synchronously perform database operations on queue, using transactions.</p>
  460. </div>
  461. <div class="method-subsection declared-in-section">
  462. <h4 class="method-subtitle">Declared In</h4>
  463. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  464. </div>
  465. </div>
  466. </div>
  467. </div><div class="section-method">
  468. <a name="//api/name/inDeferredTransaction:" title="inDeferredTransaction:"></a>
  469. <h3 class="method-title"><code><a href="#//api/name/inDeferredTransaction:">&ndash;&nbsp;inDeferredTransaction:</a></code>
  470. </h3>
  471. <div class="method-info">
  472. <div class="pointy-thing"></div>
  473. <div class="method-info-container">
  474. <div class="method-subsection brief-description">
  475. <p>Synchronously perform database operations on queue, using deferred transactions.</p>
  476. </div>
  477. <div class="method-subsection method-declaration"><code>- (void)inDeferredTransaction:(void ( ^ ) ( FMDatabase *db , BOOL *rollback ))<em>block</em></code></div>
  478. <div class="method-subsection arguments-section parameters">
  479. <h4 class="method-subtitle parameter-title">Parameters</h4>
  480. <table class="argument-def parameter-def">
  481. <tr>
  482. <th scope="row" class="argument-name"><code>block</code></th>
  483. <td><p>The code to be run on the queue of <code>FMDatabaseQueue</code></p></td>
  484. </tr>
  485. </table>
  486. </div>
  487. <div class="method-subsection discussion-section">
  488. <h4 class="method-subtitle">Discussion</h4>
  489. <p>Synchronously perform database operations on queue, using deferred transactions.</p>
  490. </div>
  491. <div class="method-subsection declared-in-section">
  492. <h4 class="method-subtitle">Declared In</h4>
  493. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  494. </div>
  495. </div>
  496. </div>
  497. </div><div class="section-method">
  498. <a name="//api/name/inSavePoint:" title="inSavePoint:"></a>
  499. <h3 class="method-title"><code><a href="#//api/name/inSavePoint:">&ndash;&nbsp;inSavePoint:</a></code>
  500. </h3>
  501. <div class="method-info">
  502. <div class="pointy-thing"></div>
  503. <div class="method-info-container">
  504. <div class="method-subsection brief-description">
  505. <p>Synchronously perform database operations using save point.</p>
  506. </div>
  507. <div class="method-subsection method-declaration"><code>- (NSError *)inSavePoint:(void ( ^ ) ( FMDatabase *db , BOOL *rollback ))<em>block</em></code></div>
  508. <div class="method-subsection arguments-section parameters">
  509. <h4 class="method-subtitle parameter-title">Parameters</h4>
  510. <table class="argument-def parameter-def">
  511. <tr>
  512. <th scope="row" class="argument-name"><code>block</code></th>
  513. <td><p>The code to be run on the queue of <code>FMDatabaseQueue</code></p></td>
  514. </tr>
  515. </table>
  516. </div>
  517. <div class="method-subsection discussion-section">
  518. <h4 class="method-subtitle">Discussion</h4>
  519. <p>Synchronously perform database operations using save point.</p>
  520. </div>
  521. <div class="method-subsection declared-in-section">
  522. <h4 class="method-subtitle">Declared In</h4>
  523. <p><code class="declared-in-ref">FMDatabaseQueue.h</code></p>
  524. </div>
  525. </div>
  526. </div>
  527. </div>
  528. </div>
  529. </div>
  530. </main>
  531. <footer>
  532. <div class="footer-copyright">
  533. <p class="copyright">Copyright &copy; 2015 ccgus. All rights reserved. Updated: 2015-11-10</p>
  534. <p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
  535. </div>
  536. </footer>
  537. </div>
  538. </div>
  539. </article>
  540. <script src="../js/script.js"></script>
  541. </body>
  542. </html>