Hi all, I have wrote a RoR app that analyzes results in a mysql database. Data is input to the database with a java GUI. Is it possible to automatically detect when new data is saved into the DB and then do something? Chris -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
try the after_save callback On 3/20/07, chris finch <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi all, > > I have wrote a RoR app that analyzes results in a mysql database. Data > is input to the database with a java GUI. Is it possible to > automatically detect when new data is saved into the DB and then do > something? > > Chris > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You could put a timestamp on each record and then do a polling loop looking for records newer than the last record you found previously. That would detect the new records inserted by Java. Michael On Mar 20, 3:17 am, chris finch <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all, > > I have wrote a RoR app that analyzes results in a mysql database. Data > is input to the database with a java GUI. Is it possible to > automatically detect when new data is saved into the DB and then do > something? > > Chris > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i misread the OP. sorry about that. On 3/20/07, MichaelLatta <lattam-ee4meeAH724@public.gmane.org> wrote:> > You could put a timestamp on each record and then do a polling loop > looking for records newer than the last record you found previously. > That would detect the new records inserted by Java. > > Michael > > On Mar 20, 3:17 am, chris finch <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > Hi all, > > > > I have wrote a RoR app that analyzes results in a mysql database. Data > > is input to the database with a java GUI. Is it possible to > > automatically detect when new data is saved into the DB and then do > > something? > > > > Chris > > > > -- > > Posted viahttp://www.ruby-forum.com/. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
christophermatthieu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Mar-22 15:37 UTC
Re: detecting when a record is saved
If MySQL supports triggers, you could create a DB trigger to execute a Ruby script upon an insertion. On Mar 20, 3:17 am, chris finch <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all, > > I have wrote a RoR app that analyzes results in a mysql database. Data > is input to the database with a java GUI. Is it possible to > automatically detect when new data is saved into the DB and then do > something? > > Chris > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---