Retrieve Entity Manager.

EM service is retrieved once and then that instance returned on each call
328030
public function _getEntityManager()
    {
        if ($this->kernel === null) {
            $this->fail('Symfony2 platform module is not loaded');
        }
        if (!isset($this->permanentServices[$this->config['em_service']])) {
            // try to persist configured EM
            $this->persistService($this->config['em_service'], true);

            if ($this->_getContainer()->has('doctrine')) {
                $this->persistService('doctrine', true);
            }
            if ($this->_getContainer()->has('doctrine.orm.default_entity_manager')) {
                $this->persistService('doctrine.orm.default_entity_manager', true);
            }
            if ($this->_getContainer()->has('doctrine.dbal.backend_connection')) {
                $this->persistService('doctrine.dbal.backend_connection', true);
            }
        }
        return $this->permanentServices[$this->config['em_service']];
    }
783579
public Client getClient(EntityMetadata m)
    {
        // // Persistence Unit used to retrieve client
        if (m == null)
        {
            throw new KunderaException("Entitymatadata should not be null");
        }
        String persistenceUnit = m.getPersistenceUnit();

        return getClient(persistenceUnit);
    }
800744
static EntityManager bind(EntityManager entityManager) {
        return entityManagerMap( true ).put( entityManager.getEntityManagerFactory(), entityManager );
    }
339335
def bindings(self, entity_id, typ, service):
        
        return self.service(entity_id, typ, service)
380947
private Long fetchServiceId(ServiceReference serviceReference) {
        return (Long) serviceReference.getProperty(org.osgi.framework.Constants.SERVICE_ID);
    }
1241732
function EntityManager(messenger)
{
  /**
   * Event messenger, injected
   * @type {Messenger}
   * @private
   */
  this.messenger = messenger;

  /**
   * Map of tags to the list of their entities.
   * @private
   */
  this._tags = {};

  /**
   * @type {Array.<Entity>}
   * @private
   */
  this._entities = [];

  /**
   * @type {Array.<Group>}
   * @private
   */
  this._groups = {};

  /**
   * Pool entities.
   * @private
   */
  this._entityPool = new ObjectPool(Entity);

  /**
   * Map of component names to their respective object pools.
   * @private
   */
  this._componentPools = {};
}
127926
def get_instance(self, payload):
        
        return EntityInstance(self._version, payload, service_sid=self._solution['service_sid'], )
4288
public static function getInstance()
    {
        $fileManager    = new FileManager();
        $serviceManager = ZendFramework2Environnement::getDependence($fileManager);
        $entityManager  = $serviceManager->get('doctrine.entitymanager.orm_default');

        if (($entityManager instanceof EntityManager) === false) {
            throw new \Exception(
                sprintf(
                    'Service manager return instanceof "%s" instead of "%s"',
                    is_object($entityManager) === true ? get_class($entityManager) : gettype($entityManager),
                    'Doctrine\ORM\EntityManager'
                )
            );
        }

        return new Doctrine2MetaDataDAO($entityManager);
    }
1358543
def getParameters(self):
        
        parameters = lock_and_call(
            lambda: self._impl.getParameters(),
            self._lock
        )
        return EntityMap(parameters, Parameter)
108450
static EntityManager proxy(EntityManager entityManager) {
    ProxyFactory proxyFactory = new ProxyFactory(entityManager);
    proxyFactory.addAdvice(new RepositoryEntityManagerEntityGraphInjector());
    return (EntityManager) proxyFactory.getProxy();
  }
570651
public ServiceInstanceEntity get(final String serviceId)
	{
		try
		{
			return serviceCache.get(serviceId, () -> dao.getById(serviceId));
		}
		catch (Exception e)
		{
			throw new RuntimeException("Error loading service: " + serviceId, e);
		}
	}
135298
@Override
    public EntityManagerFactory getEntityManagerFactory
                    (JPAPuId puId,
                     J2EEName j2eeName, // d510184
                     boolean getEmfWrapper) // d416151.3.1
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "getEntityManagerFactory : " + puId + ", " + j2eeName);

        EntityManagerFactory rtnFactory = null;
        JPAPUnitInfo puInfo = findPersistenceUnitInfo(puId);
        if (puInfo != null)
        {
            rtnFactory = puInfo.getEntityManagerFactory(j2eeName); // d510184
            if (getEmfWrapper) // d416151.3.1 d510184
            {
                rtnFactory = getJPARuntime().createJPAEMFactory(puId, j2eeName, rtnFactory); // d416151.3.1 d510184, d706751
            }
        }
        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "getEntityManagerFactory : " + rtnFactory);
        return rtnFactory;
    }
218102
def get_referenced_object(self):
        

        if self._DeviceServer is not None:
            return self._DeviceServer

        raise exception.BunqException(self._ERROR_NULL_FIELDS)
372807
def retrieve(cls, id, api_key=None, **params):
        """"""
        instance = cls(id, api_key, **params)
        d = instance.refresh()
        return d.addCallback(lambda _: instance)
651250
def _get_instance(self, **kwargs):
        """"""
        current_app.logger.info("Getting instance")
        current_app.logger.debug("kwargs: {}".format(kwargs))

        current_app.logger.info(
            "Loading instance: {}".format(kwargs['obj_id']))
        rec = self.db_query.get_instance(self.db_collection, kwargs['obj_id'])
        g._resource_instance = rec
        current_app.logger.debug(
            "g._resource_instance: {}".format(g._resource_instance))
        return rec
29162
public EntityManager getEM(String sessionToken)
    {
        if (emMap == null)
        {
            return null;
        }
        else
        {
            return emMap.get(sessionToken);
        }
    }
1010837
public static List<Audit> findByEntity(EntityManager em, JPAEntity entity) {
        return findByEntity(em, entity, null);
    }