public void save() throws POMInitException, PersistenceException{
Transaction tx = null;
try {
//判斷上下文是有活動的事務
if (!PersistentObjectManager.getPom().isTransactionActive()) {
tx = new Transaction();
}
if (tx != null) {
tx.start();
}
if (tx != null) {
tx.commit();
}
} finally {
if (tx != null) {
tx.rollback();
}
}
}
Windchill 事務的開啓與關閉
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.