Package com.isomorphic.jpa

# Class JPAConnectionHolder

java.lang.Object
com.isomorphic.jpa.JPAConnectionHolder

public class JPAConnectionHolder extends Object
Holds `EntityManager` and current transaction. Instance of this class is used to store connection information in `RPCManager` while handling Automatic Transactions.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `jakarta.persistence.EntityManager`
  `getEntityManager()`
  Returns `EntityManager` for this connection.
  `int`
  `getOpCount()`
  Returns count of operations executed.
  `Object`
  `getTransaction()`
  Returns current open transaction.
  `void`
  `increaseOpCount()`
  Increases operations count by 1.
  `void`
  `setEntityManager(jakarta.persistence.EntityManager em)`
  Sets new `EntityManager`.
  `void`
  `setTransaction(Object tx)`
  Sets new transaction.

- ## Method Details

  - ### getEntityManager

    public jakarta.persistence.EntityManager getEntityManager()
    Returns `EntityManager` for this connection.
    Returns:
      `EntityManager` for this connection.

  - ### setEntityManager

    public void setEntityManager(jakarta.persistence.EntityManager em)
    Sets new `EntityManager`.
    Parameters:
      `em` - `EntityManager` new entity manager.

  - ### getTransaction

    public Object getTransaction()
    Returns current open transaction.
    Returns:
      `Object` current transaction.

  - ### setTransaction

    public void setTransaction(Object tx)
    Sets new transaction.
    Parameters:
      `tx` - `Object` new transaction.

  - ### getOpCount

    public int getOpCount()
    Returns count of operations executed.
    Returns:
      `int` executed operations count.

  - ### increaseOpCount

    public void increaseOpCount()
    Increases operations count by 1.