On Wednesday, 7 January 2015 at 08:58:35 UTC, Suliman wrote:
thanks!

Am I right understand that in next code scope(exit) stmt.close(); occur after this execution? And it will close connection so stmt in function become unavailable.

        this(parseConfig parseconfig)
        {
         [....]

                auto conn = ds.getConnection();
                scope(exit) conn.close();

                stmt = conn.createStatement();

                scope(exit) stmt.close(); //HERE

        } void InsertData()
{
auto rs = stmt.executeUpdate(sqlinsert); // stmt now unreachable
}

scope(exit) executes at the exit of the inner most scope. Scopes end at '}'. Which is the very next line in this case.

Reply via email to