Thank you for reporting this problem, we are already working on it. For now, as a workaround you can try to call setCurrent() *before* openning a connection.
Is there a bug filed on this? If so, perhaps you could post a link. Most bugs in our internal bug database are available for viewing externally. Contact me if you need help with finding such a link.
Yes, the bug is filled, here is the link:
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.