Database: table gateway save existing fix