Interrupting a java thread is a sharp sword.
It will interrupt ALL blocking operations.

The prefered way to stop a thread is to set a static variable and have the 
thread poll that variable from time to time.



-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com<http://www.marklogic.com/>


From: [email protected] 
[mailto:[email protected]] On Behalf Of Gary Larsen
Sent: Wednesday, September 11, 2013 11:06 AM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Java thread interrupt

Hi,

In a Java application I'm using an interrupt to signal a long running thread 
that it's time to quit.  This interrupt immediately affects MarkLogic calls in 
the thread:
com.marklogic.xcc.exceptions.ServerConnectionException
[Session: user=Admin, cb=NetVisn-6.5-C1021 [ContentSource: user=Admin, 
cb=NetVisn-6.5-C1021 [provider: address=neptune/192.168.1.91:8046, pool=0/64]]]
[Client: XCC/5.0-4]
...
Caused by: java.nio.channels.ClosedByInterruptException
                at 
java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:184)
                at 
sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:511)
                at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
                at 
com.marklogic.xcc.impl.SocketPoolProvider.obtainConnection(SocketPoolProvider.java:93)

Is it possible to turn off this feature?  Thanks,

Gary

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to