Forum OpenACS Q&A: Response to Problems with Enhanced-News package

Collapse
Posted by Jonathan Ellis on
You have two problems here.  First, as you suspected, the "return" inside the db_with_3x_wrapper means it never gets to the ns_db releasehandle inside db_with_3x.  You could get around this easily by setting a variable inside the db_with_3x and doing your return later.

Second, you later on have a db_with_3x_wrapper nested inside a db_foreach, which is a Bad Thing.  You'll have to do some rewriting on that one.  (Probably the "correct" thing to do is not use ad_user_group_member at all; nesting queries like that is inefficient and usually a bad idea.  Creating a new proc ad_user_newsgroup_member_p that does it in one query would probably be better; you may or may not be able to refactor some code from ad_user_group_member.)