---
title: "很长的事务和完全阻塞方式"
author: "stephen80"
date: "2009-04-10T15:57:18Z"
tags: ["Java", "thread"]
slug: "untitled"
draft: false
lastmod: "2009-04-10T15:57:18Z"
id: 365118
url: "https://stephen80.iteye.com/blog/365118"
---

1. 很长的事务，肯定不是好的方式
  这次，在退出的时候，如果恰巧赶上很长的事务，那麻烦了。
2. 完全阻塞方式，必须用 Thread.interupt 打断，这个在NIO 的时候，
  会遇到  java.nio.channels.ClosedChannelException .
  (我对 nio 还需要继续学习，看看是否能避免这个问题) 。
