Don't deref cursor inside transact call. Maybe that is the issue....