>Am I using wrong memory context? Or
is there anything else also I should keep in mind.
Yes it might be. Memory context of
transaction is deleted at the end.
If you want to preserved the information, you can allocated space for structure before begin transaction call.
Regards,
Amul Sul