在 Windows 上,NUL 是空输出设备,类似于 Linux 上的 /dev/null。
在 Oracle Java 8 Update 331中,尝试获取会引发new FileOutputStream("NUL:")
异常。以前(Java 8u321)它工作得很好。
问题似乎出在冒号上:
new FileOutputStream("NUL")
- 好的new FileOutputStream("NUL:")
- 例外任何人都可以向我指出有关此更改的文档或 JDK 源吗?我无法更改代码本身,因为它位于第 3 方库(xnio-api)中。
try
{
new FileOutputStream("NUL:");
System.out.println("OK");
}
catch (FileNotFoundException e)
{
System.out.println(e);
}
Run Code Online (Sandbox Code Playgroud) 有没有办法在事务中添加检查约束,并且在故障回滚到上一个保存点的情况下(而不是回滚整个事务)?
在我的情况下,当ALTER TABLE ... ADD CONSTRAINT命令失败时,事务无法回滚到保存点(尝试这样做会抛出InvalidOperationException).
概述以证明关键点:
SqlTransaction transaction = connection.BeginTransaction();
// ... execute SQL commands on the transaction ...
// Create savepoint
transaction.Save("mySavepoint");
try
{
// This will fail...
SqlCommand boom = new SqlCommand(
"ALTER TABLE table WITH CHECK ADD CONSTRAINT ...",
connection,
transaction);
boom.ExecuteNonQuery();
}
catch
{
// ...and should be rolled back to the savepoint, but can't.
try
{
transaction.Rollback("mySavepoint");
}
catch (InvalidOperationException)
{
// Instead, an InvalidOperationException is thrown.
// The transaction is unusable …
Run Code Online (Sandbox Code Playgroud) 调试WF 4工作流服务(在IIS 7.5/AppFabric中托管)时,如何查看工作流变量的当前值?
我将Visual Studio 2010附加到w3wp.exe但是当活动上的断点被命中时,"Locals"调试器窗口中只显示以下参数:
尝试手动将工作流变量添加到"Watch"会导致"当前上下文中不存在名称'xyz'".
难道我做错了什么?我的环境是否搞砸了(安装了VS 2010和VS 11 Beta的Windows Server 2008 R2计算机 - VS 11是否可能破坏了某些内容)?
有任何想法吗?
.net visual-studio-2010 workflow-foundation-4 visual-studio-debugging