Dependency injection and shared / non-shared object and cron job

Something interesting happens to the Magento2 code and I can not realize what I missed. The same code works perfectly through the browser and does not work through cron.

(in the administration area) I calculate the result in AnotherClass that must depend on the value of $ this-> myProperty.

$ this-> myProperty is maintained in MyWorkingClass and read from AnotherClass because (in my opinion) the structure will create a new instance of AnotherClass where this property is not established.

Everything works as expected when I run Magento in the browser. But when you run cron (either manually in cli-cron: run or by programming) I see an unexpected result in the records.

Any help is appreciated!

`

MyWorkingClass class
{
$ private myProperty;

...

public function doStuff ($ params)
{
$ result = $ this-> someFactory-> create () -> getSomethingUseful ();
$ this-> logEverything ($ result);
$ this-> myProperty = 1;
$ result = $ this-> someFactory-> create () -> getSomethingUseful ();
$ this-> logEverything ($ result);
}

Public function getMyProperty ()
{
returns $ this-> myProperty;
}
...
}

AnotherClass class
{
...

Public function getSomethingUseful ()
{
$ objectManager =  Magento  Framework  App  ObjectManager :: getInstance ();
$ myClassObject = $ objectManager-> get (& # 39; Vendor  Module  Model  MyWorkingClass & # 39;);
$ myProperty = $ myClassObject-> getMyProperty ();
yes ($ myProperty == 1) {
$ result = 2 * 2;
return "Everything is fine now! 2 x 2 = $ result";
}
back "Nothing works, 2 x 2 = 5";
}

} `