Mixing Models in A Sphinx Server

I have some secondary tables in my Sphinx database and, based on a conversation in another thread, I am trying to run them under a different model (default at the moment).

On my Server Module I have

SphinxConfig1: TSphinxConfig;
    SphinxServer1: TSphinxServer;
    Dispatcher: TSparkleHttpSysDispatcher;
    AureliusDBSchema: TAureliusDBSchema;
    AureliusConnection1: TAureliusConnection;
    DataConnectionPool: TXDataConnectionPool;
    Connection: TFDConnection;
    RegisterServer: TXDataServer;

Dispatcher serves both SphinxServer1 and RegisterServer.
I have linked DataConnectionPool to both SphinxServer1 and RegisterServer (I'm not sure I'm meant to do this)

In SphinxConfig1ConfigureToken I need to access an entity in the default model so I create a TObjectManager but it fails to find the entity. Do I need a different DataPool?

No, the pool just provides a database connection and has nothing to do with models.

You should just create the TObjectManager with the proper model you want to use. What is the code you are using?

lRegisterManager := TObjectManager.Create(RegisterServer.Pool.GetPoolInterface.GetConnection)

The exception I get is

Project GASphinx.exe raised exception class EPoolAcquireException with message 'Cannot retrieve object from object pool.'.

And that is on

RegisterServer.Pool.GetPoolInterface.GetConnection

Looking at the stack it seems to be here:

function TObjectPool<T>.Acquire: T;
var
  I: integer;
  Empty: Integer;
begin
  if FSemaphore.WaitFor(AcquireTimeout) <> wrSignaled then
    raise EPoolAcquireException.Create;
  FSection.Enter;  //<----

The message is simple, there are no more connections available in the pool.
What is the size of your pool?

That would be it.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.