Interface DatabaseProcedure


  • public interface DatabaseProcedure
    This interface represents a database procedure that is executed on the server side. It is used to perform database specific functions that can only be performed on the server.

    A procedure must manage its own table locking.

    Author:
    Tobias Downer
    • Method Detail

      • execute

        Table execute​(User user,
                      java.lang.Object[] args)
               throws DatabaseException
        Executes the procudure and returns the resultant table. Note, the args have to be serializable. There may be only 0 to 16 arguments. The method may throw a 'DatabaseException' if the procedure failed.
        Throws:
        DatabaseException
      • getLockingMode

        int getLockingMode()
        Returns the locking mode in which the database operates. This is either LockingMechanism.SHARED_MODE or LockingMechanism.EXCLUSIVE_MODE. In most cases this will be SHARED_MODE.
      • setLockHandle

        void setLockHandle​(LockHandle lock_handle)
        Sets the LockHandle object for this procedure. This should be called after the tables that this procedure uses have been locked.