Index: Z:/workspace-jboss-as/connector/src/main/org/jboss/resource/adapter/mail/inflow/NewMsgsWorker.java =================================================================== --- Z:/workspace-jboss-as/connector/src/main/org/jboss/resource/adapter/mail/inflow/NewMsgsWorker.java (revision 61632) +++ Z:/workspace-jboss-as/connector/src/main/org/jboss/resource/adapter/mail/inflow/NewMsgsWorker.java (working copy) @@ -73,8 +73,6 @@ try { MailActivation ma = (MailActivation) pollQueue.take(); - if( ma.isReleased() ) - continue; // Wait until its time to check for new msgs long now = System.currentTimeMillis(); long nextTime = ma.getNextNewMsgCheckTime(); @@ -82,7 +80,9 @@ Thread.sleep(sleepMS); if( released ) break; - + // This has to go after the sleep otherwise we can get into an inconsistent state + if( ma.isReleased() ) + continue; // Now schedule excecution of the new msg check mgr.scheduleWork(ma, WorkManager.INDEFINITE, null, this); }