Expand my Community achievements bar.

SOLVED

blaze-ds persistence object

Avatar

Former Community Member
Hey All,



I need to have a object persistence in memory and available
for all connected clients.

How should I go ahead and do this?



I was thinking to create a class with a static variable and
store/load this using a session, me hoping that the static variable
is the same for all connected clients. But I am not sure if this is
the right approach, is it??



If not... what would be the right appreach?



Preferred I need to have this accessible in a adapter using
messeging aswell using remoting.



any ideas, samples, pointers?



Ries





1 Accepted Solution

Avatar

Correct answer by
Former Community Member
I think you can define the object that you need to make
available to all connected clients as a BlazeDS destination with
the application scope. Here is an example:



<destination id="SampleEmployeeRO">

<properties>


<source>samples.explorer.EmployeeManager</source>

<scope>application</scope>

</properties>

</destination>



Here is a link to the doc:


http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=rpc_config_2.html#260036

The scope ... "Indicates whether the object is available in
the request scope, the application scope, or the session scope.
Objects in the request scope are stateless. Objects in the
application scope are available to the web application that
contains the object. Objects in the session scope are available to
the entire client session."



- Mykola





The valid values are request, application, and session. The
default value is request.

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member
I think you can define the object that you need to make
available to all connected clients as a BlazeDS destination with
the application scope. Here is an example:



<destination id="SampleEmployeeRO">

<properties>


<source>samples.explorer.EmployeeManager</source>

<scope>application</scope>

</properties>

</destination>



Here is a link to the doc:


http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=rpc_config_2.html#260036

The scope ... "Indicates whether the object is available in
the request scope, the application scope, or the session scope.
Objects in the request scope are stateless. Objects in the
application scope are available to the web application that
contains the object. Objects in the session scope are available to
the entire client session."



- Mykola





The valid values are request, application, and session. The
default value is request.
The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----