[Glass] Semaphore error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Glass] Semaphore error

GLASS mailing list

Ciao,

i work with Gemstone 3.1.0.6  environment.

I need to manage a critical access ( not simultaneous use of the device ) to printer device.

I define a  printer "data base " with  accessSema   instance set to:

^ accessSema ifNil:[ accessSema := Semaphore forMutualExclusion ]


and a method : critical: mutuallyExcludedBlock 

^ self accessSema critical: mutuallyExcludedBlock 
But when i do the printer command with:

aPrinter critical:[   

the system answer:

a TransactionError occurred (error 2407), The object Semaphore(316884481) may not be committed, 'instances of its class are non-persistent'

How i can manage a global critical access to the printer device ?

Considerations ?

Thanks,

Dario

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] Semaphore error

GLASS mailing list
Try using a TransientSemaphore in place of Semaphore. It's designed to be used in chunks of code that may become persistent ...

Dale

On Sat, Nov 29, 2014 at 5:15 AM, Dario Trussardi via Glass <[hidden email]> wrote:

Ciao,

i work with Gemstone 3.1.0.6  environment.

I need to manage a critical access ( not simultaneous use of the device ) to printer device.

I define a  printer "data base " with  accessSema   instance set to:

^ accessSema ifNil:[ accessSema := Semaphore forMutualExclusion ]


and a method : critical: mutuallyExcludedBlock 

^ self accessSema critical: mutuallyExcludedBlock 
But when i do the printer command with:

aPrinter critical:[   

the system answer:

a TransactionError occurred (error 2407), The object Semaphore(316884481) may not be committed, 'instances of its class are non-persistent'

How i can manage a global critical access to the printer device ?

Considerations ?

Thanks,

Dario

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass



_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass