You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sommeralex <al...@gmail.com> on 2012/10/25 00:09:50 UTC

easiest way to update a value on a DB change?

Hello!

I have a user class with a specific value, in my case a cash value. I am
showing this cash value in a widget via  ${user.cash}. If the user is logged
in on the server, and the cash is changed for whatever reason, i would like
to auto update this value. Currently, the user has to re-login to get an
updated cash value - sure, this is not what I want.

Is the only possible solution making a periodic zone updater, or is there
something else i could use?

thx
alex



--
View this message in context: http://tapestry.1045711.n5.nabble.com/easiest-way-to-update-a-value-on-a-DB-change-tp5717204.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: easiest way to update a value on a DB change?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 24 Oct 2012 22:14:56 -0200, sommeralex  
<al...@gmail.com> wrote:

> thx - sure. forget about this ;-)

:)

I think there are two different issues in your scenario, none related to  
Tapestry:

1) Databases usually don't have any way of notifying changes to anything  
outside them.
2) In web development, at least using HTTP, we don't have any way of  
having a server trading information with clients (server-side push)*  
except during a client doing a request to the server.

* There may be some specification or proposal about this right now, but I  
can't recall any that can be used across different browsers right now, and  
that's why we have Cometd and other packages that use polling (periodical  
requests or keeping a connection open and making many requests before  
closing the connection) to simulate server-side push.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: easiest way to update a value on a DB change?

Posted by sommeralex <al...@gmail.com>.
thx - sure. forget about this ;-)

2012/10/25 Thiago H de Paula Figueiredo [via Tapestry] <
ml-node+s1045711n5717205h97@n5.nabble.com>

> On Wed, 24 Oct 2012 20:09:50 -0200, sommeralex
> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5717205&i=0>>
> wrote:
>
> > Hello!
>
> Hi!
>
> > I have a user class with a specific value, in my case a cash value. I am
> > showing this cash value in a widget via  ${user.cash}. If the user is
> > logged in on the server, and the cash is changed for whatever reason, i
>
> > would like to auto update this value. Currently, the user has to
> > re-login to get an
> > updated cash value - sure, this is not what I want.
> > Is the only possible solution making a periodic zone updater, or is
> there
> > something else i could use?
>
> I think you can either use a periodic zone updater (examples from
> JumpStart:
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/periodicupdatemixin,
>
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/periodicupdate)
>
> or use something like tapestry-cometd
> (https://github.com/uklance/tapestry-cometd).
>
> --
> Thiago H. de Paula Figueiredo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5717205&i=1>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5717205&i=2>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://tapestry.1045711.n5.nabble.com/easiest-way-to-update-a-value-on-a-DB-change-tp5717204p5717205.html
>  To unsubscribe from easiest way to update a value on a DB change?, click
> here<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5717204&code=YWxleGFuZGVyLnNvbW1lckBnbWFpbC5jb218NTcxNzIwNHwxMDUzMzQxMzM4>
> .
> NAML<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://tapestry.1045711.n5.nabble.com/easiest-way-to-update-a-value-on-a-DB-change-tp5717204p5717206.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: easiest way to update a value on a DB change?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 24 Oct 2012 20:09:50 -0200, sommeralex  
<al...@gmail.com> wrote:

> Hello!

Hi!

> I have a user class with a specific value, in my case a cash value. I am
> showing this cash value in a widget via  ${user.cash}. If the user is  
> logged in on the server, and the cash is changed for whatever reason, i  
> would like to auto update this value. Currently, the user has to  
> re-login to get an
> updated cash value - sure, this is not what I want.
> Is the only possible solution making a periodic zone updater, or is there
> something else i could use?

I think you can either use a periodic zone updater (examples from  
JumpStart:  
http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/periodicupdatemixin,  
http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/periodicupdate)  
or use something like tapestry-cometd  
(https://github.com/uklance/tapestry-cometd).

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org