[Xapian-tickets] [Xapian] #337: Extend test of behaviour of databases after close

Xapian nobody at xapian.org
Fri Apr 6 23:27:13 BST 2018


#337: Extend test of behaviour of databases after close
--------------------------+------------------------------
 Reporter:  richard       |             Owner:  gp1308
     Type:  defect        |            Status:  new
 Priority:  low           |         Milestone:  1.4.x
Component:  Test Suite    |           Version:  SVN trunk
 Severity:  normal        |        Resolution:
 Keywords:  GoodFirstBug  |        Blocked By:
 Blocking:                |  Operating System:  All
--------------------------+------------------------------

Comment (by olly):

 If `begin_transaction()` failed you aren't in a transaction.

 When you aren't in a transaction, `commit_transaction()` is not a valid
 operation, so `InvalidOperationError` is correct (as I said above).

 If you are in a transaction, `commit_transaction()` on a closed database
 should either just end the transaction or throw `DatabaseError`.  (The
 first option assumes there's not actually anything to commit, but I'm not
 sure how you could have anything to commit since e.g. `add_document()` on
 a closed database should throw `DatabaseError`, and `Database::close()`
 should end any active transaction so you can't have a transaction active
 from before the `close()`).

--
Ticket URL: <https://trac.xapian.org/ticket/337#comment:16>
Xapian <https://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list