Class TransactionalWorker

java.lang.Object
org.hibernate.search.backend.impl.TransactionalWorker
All Implemented Interfaces:
Worker

public class TransactionalWorker extends Object implements Worker
Queue works per transaction. If out of transaction, the work is executed right away

When hibernate.search.worker.type is set to async the work is done in a separate thread (threads are pooled)

  • Field Details

  • Constructor Details

    • TransactionalWorker

      public TransactionalWorker()
  • Method Details

    • performWork

      public void performWork(Work<?> work, TransactionContext transactionContext)
      Description copied from interface: Worker
      Declare a work to be done within a given transaction context
      Specified by:
      performWork in interface Worker
      Parameters:
      work - the work to be executed
      transactionContext - transactional context information
    • initialize

      public void initialize(Properties props, WorkerBuildContext context)
      Specified by:
      initialize in interface Worker
    • close

      public void close()
      Description copied from interface: Worker
      clean resources This method can return exceptions
      Specified by:
      close in interface Worker
    • flushWorks

      public void flushWorks(TransactionContext transactionContext)
      Description copied from interface: Worker
      Flush any work queue.
      Specified by:
      flushWorks in interface Worker
      Parameters:
      transactionContext - the current transaction (context).