Confused by correct ActiveJob use

I am confused by the ActiveJob (sucker_punch) interaction with ActiveRecords.

After a while the application is running, logs start receiving:

[…]
E, [2015-03-19T12:48:20.770265 #31422] ERROR – : Actor crashed!
ActiveJob::DeserializationError: Error while trying to deserialize arguments: OCIError: ORA-03135: connessione interrotta
ID processo: 16538
[…]

It looks the actor is trying to use a stale ActiveRecord session.

Apart from the actor, ActiveRecords works fine in the application. Connection to db is ok.

Is it possibile actors are “detached” from application so they are unable to check out a new connection from the pool?

How can I avoid that?

Pointers are greatly appreciated,

thank you,

Francesco

I found useful the following:

  1. wrap ActiveRecord calls in a
ActiveRecord::Base.connection_pool.with_connection
block.
It was written on the sucker_punch documentation;
2) while invoking active_job tasks, avoid using GlobalID.
I feel the deserialization of the activerecord object was the *casus belli* of the failure I experienced.

Francesco