I don't know your situation, but the Session object may help. After much testing, I try to avoid any SET DATASESSION TO commands. If you have an object that has it's own datasession, try to run a method or examine a property instead of switching DataSessions.
Charlie