Error on 'Shared memory' action

Hello,

I have this error on ‘Shared memory’ action:

“Can’t access shared memory because it’s locked. Are you using a file repository from two computers simultaneously? database is locked database is locked (5).”

This error is in this scenario: multiple EM scripts (I guess) are running through EasyMorph Command-Line Worker (5.3.0.0) on Windows Scheduler.
There is no other computer that can access the EM repository. Also all the operation on shared memory are list operation.

What can I do ?

Thank you,
Radu.

Hi Radu,

If you have two or more instances of CLW accessing the Shared Memory, this error can appear because the instances are not aware of each other and can’t coordinate their access to Shared Memory. Hence access conflicts.

The best way to mitigate the problem is to use a repository hosted on EasyMorph Server. In this case, both CLW instances would use the same repository on the Server, and the Server will coordinate access to Shared Memory and resolve conflicts.

Many thanks for your response!
Unfortunatly for us EasyMorphServer it is not an option right now. We use ‘Shared Memory’ action to obtainn, based on config file, the path of the .qvd files where are the data, because there are not the same on dev and production enviroment. For this usage can you recomand a better approch ?

You can also use the “Exclusive access” action. It’s intended for managing access to a shared resource that can only be accessed once at a time. Note that the action only works if used on the same machine for the same resource name.

Put “Exclusive access:start” before “Shared Memory” and then “Shared access:stop” after it.

Hello @sradum ,

can you be more specific about the problem? I ask you this because it happens to have different settings but you can simply read the file, in EM, and use its content to obtain the path.

I mean:

  • You’ve got the config.txt files in the same directory of the .morph file, for example:
    c:\oneDirectory\config.txt >> on the the develop server
    c:\anotherDir\config.txt >> on the production server
  • The morph file is in the same directory of the config.txt
  • As first action of the morph, you open ./config.txt file (./ means you read from the same directory of the morph file)

Good point. You are right. For this case shared memory it is not a must.

Thank you.