added database support for tx