これは一般的な問題であり、オブジェクトの誤ったクロージャ/リサイクル(欠落または順序が狂っている)に関連しています。E0 * TMファイルは、オブジェクトが生きている間に作成され、リサイクル時にクリーンアップされます。
それらが正しい場合は、削除をブロックしているウイルス対策ソフトウェアが実行されているかどうかを確認してください。
次のサンプルコードは、動作する前にこれをテストするために使用したので、あなたのものと比較してください。
try {
System.out.println("Start");
String path = "test.txt";
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
System.out.println("Get DB");
Database db = session.getCurrentDatabase();
System.out.println("View + doc");
View vw = db.getView("main");
Document doc = vw.getFirstDocument();
System.out.println("Embedded object");
EmbeddedObject att = doc.getAttachment(path);
InputStream is = att.getInputStream();
ByteArrayOutputStream fos = new ByteArrayOutputStream();
byte buffer[] = new byte[(int) att.getFileSize()];
int read;
do {
read = is.read(buffer, 0, buffer.length);
if (read > 0) {
fos.write(buffer, 0, read);
}
} while (read > -1);
fos.close();
is.close();
// recycle the domino variables
doc.recycle();
vw.recycle();
db.recycle();
att.recycle();
} catch (Exception e) {
e.printStackTrace();
}