fix "null" db transactions
merge from trunk
merge from lp:~wbrowa/openpetraorg/20140903_null_DB_transaction_fixes