• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Shared Objects > Temporary and Persistent Shared Objects

8.5. Temporary and Persistent Shared Objects

The preceding examples in this chapter all used temporary shared objects. Each temporary shared object is created either by a server-side script or when the first client with write access tries to connect to the shared object. The shared object is disposed of as soon as it is no longer in use by the server-side script and by its clients. At the very latest, it will be disposed of when the application instance shuts down. If you tried out the shared ball example, you may have noticed that if every client disconnected, the application did not remember the last position of the ball. The ball position was simply reset by the first client to connect. The shared ball example does not use a server-side script, so the shared object is created when the first client connects and then disposed of when the last client disconnects.

If you need to retain shared object data even after the application instance quits, you can create a persistent shared object, which is stored on the server and available the next time an instance starts up. Use persistent shared objects whenever you need to maintain application state between instance sessions.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint