SCHEMA-50. Update code to new resource retain/release mechanism.

Signed-off-by: Robert Chu <robert@wibidata.com>