You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Reyes <ri...@gmail.com> on 2005/07/14 03:52:55 UTC

[OT] Java as a Daemon

Hello Guys,

I need your suggestions. I have a task to create an application to
sync records between 2 Oracle 10g database. Not the whole records of
the database though, just the now and then transactional updates.
Access to the db's would be both via web services. I think I have an
option to do this like
- a simple java application executed via .sh file 
- a java application running as a daemon on a unix box

But I really am not sure which better path I should take. Any
suggestions would be very much appreciated.

Thanks
Richard

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Java as a Daemon

Posted by Richard Reyes <ri...@gmail.com>.
thanks
On 7/14/05, Leon Rosenberg <st...@anotheria.net> wrote:
> I'm with Larry. Cron rocks. The only problem you should have in mind: if
> your job needs more then the time between the jobs, you've lost.
> We had actually this problem, and it killed the db, because (2 years
> after initially written) the script lasted more then 24 hours, and after
> a week 5 instances of it runned, blocking each other and producing a
> load of 10 on the machine.
> 
> So simply add a check "am I already running" to your code, and it will
> be fine :-)
> 
> regards
> Leon
> 
> On Wed, 2005-07-13 at 21:49 -0600, Larry Meadors wrote:
> > I would probably go the route of the .sh file.
> >
> > At the risk of starting a big flame war, cron is solid as a rock, and
> > all of the memory used by your app will be freed up when the JVM
> > exits. Why make it more complex by adding quartz or tomcat to the mix
> > if you do not have to.
> >
> > Simple is *almost* always better.
> >
> > Larry
> >
> >
> > On 7/13/05, Richard Reyes <ri...@gmail.com> wrote:
> > > Hello Guys,
> > >
> > > I need your suggestions. I have a task to create an application to
> > > sync records between 2 Oracle 10g database. Not the whole records of
> > > the database though, just the now and then transactional updates.
> > > Access to the db's would be both via web services. I think I have an
> > > option to do this like
> > > - a simple java application executed via .sh file
> > > - a java application running as a daemon on a unix box
> > >
> > > But I really am not sure which better path I should take. Any
> > > suggestions would be very much appreciated.
> > >
> > > Thanks
> > > Richard
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Java as a Daemon

Posted by Leon Rosenberg <st...@anotheria.net>.
I'm with Larry. Cron rocks. The only problem you should have in mind: if
your job needs more then the time between the jobs, you've lost. 
We had actually this problem, and it killed the db, because (2 years
after initially written) the script lasted more then 24 hours, and after
a week 5 instances of it runned, blocking each other and producing a
load of 10 on the machine.

So simply add a check "am I already running" to your code, and it will
be fine :-)

regards
Leon

On Wed, 2005-07-13 at 21:49 -0600, Larry Meadors wrote:
> I would probably go the route of the .sh file.
> 
> At the risk of starting a big flame war, cron is solid as a rock, and
> all of the memory used by your app will be freed up when the JVM
> exits. Why make it more complex by adding quartz or tomcat to the mix
> if you do not have to.
> 
> Simple is *almost* always better.
> 
> Larry
> 
> 
> On 7/13/05, Richard Reyes <ri...@gmail.com> wrote:
> > Hello Guys,
> > 
> > I need your suggestions. I have a task to create an application to
> > sync records between 2 Oracle 10g database. Not the whole records of
> > the database though, just the now and then transactional updates.
> > Access to the db's would be both via web services. I think I have an
> > option to do this like
> > - a simple java application executed via .sh file
> > - a java application running as a daemon on a unix box
> > 
> > But I really am not sure which better path I should take. Any
> > suggestions would be very much appreciated.
> > 
> > Thanks
> > Richard
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Java as a Daemon

Posted by Daniel Henrique Ferreira e Silva <dh...@gmail.com>.
Hi,

Just adding my 2 cents.
Go with Duncan because:
1) He works for Oracle, so he _must_ know what he's saying :)
2) His approach works nice here in my job. Oracle's replication
features work good. If you are a bad luck guy that doesn't have a DBA
in your team (yeah, it is possible) you can try using a db link so
your code doesn't need to make two database connections. Let Oracle
handle the connection to the other database :)

HTH,
Daniel Silva.



On 7/14/05, David Whipple <dw...@dtcc.com> wrote:
> We use the cron approach as well.  Using a simple mechanism and having
> separate JVMs has proven very good for maintenance, etc.
> 
> Dave
> 
> 
> 
> 
>              Larry Meadors
>              <larry.meadors@gm
>              ail.com>                                                   To
>                                        Struts Users Mailing List
>              07/13/2005 11:49          <us...@struts.apache.org>, Richard
>              PM                        Reyes <ri...@gmail.com>
>                                                                         cc
> 
>              Please respond to                                     Subject
>                "Struts Users           Re: [OT] Java as a Daemon
>                Mailing List"
>              <user@struts.apac
>                   he.org>
> 
> 
> 
> 
> 
> 
> 
> I would probably go the route of the .sh file.
> 
> At the risk of starting a big flame war, cron is solid as a rock, and
> all of the memory used by your app will be freed up when the JVM
> exits. Why make it more complex by adding quartz or tomcat to the mix
> if you do not have to.
> 
> Simple is *almost* always better.
> 
> Larry
> 
> 
> On 7/13/05, Richard Reyes <ri...@gmail.com> wrote:
> > Hello Guys,
> >
> > I need your suggestions. I have a task to create an application to
> > sync records between 2 Oracle 10g database. Not the whole records of
> > the database though, just the now and then transactional updates.
> > Access to the db's would be both via web services. I think I have an
> > option to do this like
> > - a simple java application executed via .sh file
> > - a java application running as a daemon on a unix box
> >
> > But I really am not sure which better path I should take. Any
> > suggestions would be very much appreciated.
> >
> > Thanks
> > Richard
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Java as a Daemon

Posted by David Whipple <dw...@dtcc.com>.
We use the cron approach as well.  Using a simple mechanism and having
separate JVMs has proven very good for maintenance, etc.

Dave



                                                                           
             Larry Meadors                                                 
             <larry.meadors@gm                                             
             ail.com>                                                   To 
                                       Struts Users Mailing List           
             07/13/2005 11:49          <us...@struts.apache.org>, Richard   
             PM                        Reyes <ri...@gmail.com>     
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
               "Struts Users           Re: [OT] Java as a Daemon           
               Mailing List"                                               
             <user@struts.apac                                             
                  he.org>                                                  
                                                                           
                                                                           
                                                                           




I would probably go the route of the .sh file.

At the risk of starting a big flame war, cron is solid as a rock, and
all of the memory used by your app will be freed up when the JVM
exits. Why make it more complex by adding quartz or tomcat to the mix
if you do not have to.

Simple is *almost* always better.

Larry


On 7/13/05, Richard Reyes <ri...@gmail.com> wrote:
> Hello Guys,
>
> I need your suggestions. I have a task to create an application to
> sync records between 2 Oracle 10g database. Not the whole records of
> the database though, just the now and then transactional updates.
> Access to the db's would be both via web services. I think I have an
> option to do this like
> - a simple java application executed via .sh file
> - a java application running as a daemon on a unix box
>
> But I really am not sure which better path I should take. Any
> suggestions would be very much appreciated.
>
> Thanks
> Richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Java as a Daemon

Posted by Larry Meadors <la...@gmail.com>.
I would probably go the route of the .sh file.

At the risk of starting a big flame war, cron is solid as a rock, and
all of the memory used by your app will be freed up when the JVM
exits. Why make it more complex by adding quartz or tomcat to the mix
if you do not have to.

Simple is *almost* always better.

Larry


On 7/13/05, Richard Reyes <ri...@gmail.com> wrote:
> Hello Guys,
> 
> I need your suggestions. I have a task to create an application to
> sync records between 2 Oracle 10g database. Not the whole records of
> the database though, just the now and then transactional updates.
> Access to the db's would be both via web services. I think I have an
> option to do this like
> - a simple java application executed via .sh file
> - a java application running as a daemon on a unix box
> 
> But I really am not sure which better path I should take. Any
> suggestions would be very much appreciated.
> 
> Thanks
> Richard
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Java as a Daemon

Posted by Richard Reyes <ri...@gmail.com>.
Hi David,

We are using Netsuit business suite, I am not sure If I can update any
DAO. But I think I can run it on the same or separate webserver (
Tomcat ?? ). I think Quartz can be helpful, Ill check if its okay from
the top.

Thanks
Richard

On 7/14/05, David G. Friedman <hu...@ix.netcom.com> wrote:
> Richard,
> 
> Can you run it in your webapp container?  You could then update an object in
> application scope with the id's of what records have changed.  You could
> even change your DAO to perform that step for you.  Then you could have the
> quartz scheduler running to periodically update things without needing to
> run any additional code, crontab, atq, etc.   All of this from inside your
> Struts webapp.  FYI, Quartz is at http://www.opensymphony.com/quartz and no,
> I have no affiliation with them. LOL.
> 
> Regards,
> David
> 
> -----Original Message-----
> From: Richard Reyes
> Subject: [OT] Java as a Daemon
> 
> Hello Guys,
> 
> I need your suggestions. I have a task to create an application to
> sync records between 2 Oracle 10g database. Not the whole records of
> the database though, just the now and then transactional updates.
> Access to the db's would be both via web services. I think I have an
> option to do this like
> - a simple java application executed via .sh file
> - a java application running as a daemon on a unix box
> 
> But I really am not sure which better path I should take. Any
> suggestions would be very much appreciated.
> 
> Thanks
> Richard
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [OT] Java as a Daemon

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Richard,

Can you run it in your webapp container?  You could then update an object in
application scope with the id's of what records have changed.  You could
even change your DAO to perform that step for you.  Then you could have the
quartz scheduler running to periodically update things without needing to
run any additional code, crontab, atq, etc.   All of this from inside your
Struts webapp.  FYI, Quartz is at http://www.opensymphony.com/quartz and no,
I have no affiliation with them. LOL.

Regards,
David

-----Original Message-----
From: Richard Reyes
Subject: [OT] Java as a Daemon

Hello Guys,

I need your suggestions. I have a task to create an application to
sync records between 2 Oracle 10g database. Not the whole records of
the database though, just the now and then transactional updates.
Access to the db's would be both via web services. I think I have an
option to do this like
- a simple java application executed via .sh file
- a java application running as a daemon on a unix box

But I really am not sure which better path I should take. Any
suggestions would be very much appreciated.

Thanks
Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org