Merge pull request #4 from flaviogrossi/master

for the delete() method, query is not logged when enabling debug and a transaction is used
Add transaction support to Dbobject.count()
be sure to always release lock when exception occurs