Search code examples
javastardog

Stardog Connection.commit() raising java.nio.channels.ClosedChannelException


I am trying to add statements to a stardog connection using a connection pool. For some reason about halfway through data ingest, I get a ClosedChannelConnectionException when I try to commit.

// This all runs in a loop
while ... {
  def conn = connPool.obtain()
  conn.begin()

  // Add some statements here
  conn.add()...

  conn.commit() // This line throws the exception

  connPool.release(conn)
}

The exception is:

com.complexible.stardog.StardogException: java.nio.channels.ClosedChannelException

After the exception, the stardog server crashes, but there are no errors in the logs. When I restart the server, the database I was using is offline and I have to recreate it to use it.

I am using Stardog 2.1 Community Edition.

Can anyone help with this? Thanks!


Solution

  • I was running an in-memory database and the server was crashing because the machine ran out of memory.