pkg/graphdb: use transactions for transactions

Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Merge pull request #9746 from unclejack/graphdb_fix

pkg/graphdb: use transactions for transactions