You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Eric Dobbs <er...@dobbse.net> on 2001/11/02 18:42:20 UTC

Re: Scheduled Job Problem

Hello Dave.

Thanks for the patch.

I just committed it to jakarta-turbine-2.  You'll generally get a
faster response when patches are submitted as diffs.  And if you
put [PATCH] on the subject line, it has less chance of being
missed.  Here's some useful documentation about submitting patches
in the future:  http://jakarta.apache.org/site/bugs.html

Thanks again.
-Eric

On Wednesday, October 31, 2001, at 07:06  AM, Dave Hollar wrote:

> Yes - I did resolve this.  I made a change to JobEntry.save() and then
> rebuilt the turbine jar.  The change I made is below .. As you can see 
> when
> there is not yet a primary key a null would be returned and then the 
> long
> value cannot be gotten.  It seemed from postings from this summer that
> others identified this problem but the change never made it into CVS.
>
> public void save()
>        throws Exception
> {
>        Criteria criteria = new Criteria(9)
>             .add(JobEntryPeer.SECOND, getSecond())
>             .add(JobEntryPeer.MINUTE, getMinute())
>             .add(JobEntryPeer.HOUR, getHour())
>             .add(JobEntryPeer.WEEKDAY, getWeekday())
>             .add(JobEntryPeer.DAY_OF_MONTH, getDay_of_month())
>             .add(JobEntryPeer.TASK, getTask())
>             .add(JobEntryPeer.EMAIL, getEmail())
>             .add(JobEntryPeer.PROPERTY, getProperty());
>         /*   REPLACED:
>             long key =
> ((NumberKey)getPrimaryKey()).getBigDecimal().longValue();
>         */
>         NumberKey nk = (NumberKey)getPrimaryKey();
>         long key = 0;
>         if (nk != null)
>         {
>             key = 
> ((NumberKey)getPrimaryKey()).getBigDecimal().longValue();
>         }
>         if ( isModified() && key > 0)
>         {
>             // This is an update.
>             criteria.add(JobEntryPeer.OID, getPrimaryKey());
>             JobEntryPeer.doUpdate(criteria);
>             setModified(false);
>         }
>         else
>         {
>             setPrimaryKey( JobEntryPeer.doInsert(criteria) );
>         }
>    }
> ----- Original Message -----
> From: Matthew Forder
> To: Turbine User
> Sent: Wednesday, October 31, 2001 7:16 AM
> Subject: Re: Scheduled Job Problem
>
>
> I saw that Dave Hollar posted a problem re: NullPointer exception when
> trying to add a new JobEntry to the Scheduler service.
> Dave, did you ever manage to resolve this problem?
> Regards,
> Matt
> --
>    ____  | Matthew J. Forder         | Data Center Supervisor
>   / / () | Seagate Techology         | Tel:+31 20 316 7468
>   \ \ \  | Koolhovenlaan 1           | Fax:+31 20 653 5537
>  ()_/_/  | 1119 NB Schiphol-Rijk, NL | matthew.forder@seagate.com
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:turbine-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-user-
> help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Scheduled Job Problem

Posted by Dave Hollar <da...@bizpiranha.com>.
Thanks, Eric!

----- Original Message -----
From: "Eric Dobbs" <er...@dobbse.net>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Friday, November 02, 2001 12:42 PM
Subject: Re: Scheduled Job Problem


> Hello Dave.
>
> Thanks for the patch.
>
> I just committed it to jakarta-turbine-2.  You'll generally get a
> faster response when patches are submitted as diffs.  And if you
> put [PATCH] on the subject line, it has less chance of being
> missed.  Here's some useful documentation about submitting patches
> in the future:  http://jakarta.apache.org/site/bugs.html
>
> Thanks again.
> -Eric
>
> On Wednesday, October 31, 2001, at 07:06  AM, Dave Hollar wrote:
>
> > Yes - I did resolve this.  I made a change to JobEntry.save() and then
> > rebuilt the turbine jar.  The change I made is below .. As you can see
> > when
> > there is not yet a primary key a null would be returned and then the
> > long
> > value cannot be gotten.  It seemed from postings from this summer that
> > others identified this problem but the change never made it into CVS.
> >
> > public void save()
> >        throws Exception
> > {
> >        Criteria criteria = new Criteria(9)
> >             .add(JobEntryPeer.SECOND, getSecond())
> >             .add(JobEntryPeer.MINUTE, getMinute())
> >             .add(JobEntryPeer.HOUR, getHour())
> >             .add(JobEntryPeer.WEEKDAY, getWeekday())
> >             .add(JobEntryPeer.DAY_OF_MONTH, getDay_of_month())
> >             .add(JobEntryPeer.TASK, getTask())
> >             .add(JobEntryPeer.EMAIL, getEmail())
> >             .add(JobEntryPeer.PROPERTY, getProperty());
> >         /*   REPLACED:
> >             long key =
> > ((NumberKey)getPrimaryKey()).getBigDecimal().longValue();
> >         */
> >         NumberKey nk = (NumberKey)getPrimaryKey();
> >         long key = 0;
> >         if (nk != null)
> >         {
> >             key =
> > ((NumberKey)getPrimaryKey()).getBigDecimal().longValue();
> >         }
> >         if ( isModified() && key > 0)
> >         {
> >             // This is an update.
> >             criteria.add(JobEntryPeer.OID, getPrimaryKey());
> >             JobEntryPeer.doUpdate(criteria);
> >             setModified(false);
> >         }
> >         else
> >         {
> >             setPrimaryKey( JobEntryPeer.doInsert(criteria) );
> >         }
> >    }
> > ----- Original Message -----
> > From: Matthew Forder
> > To: Turbine User
> > Sent: Wednesday, October 31, 2001 7:16 AM
> > Subject: Re: Scheduled Job Problem
> >
> >
> > I saw that Dave Hollar posted a problem re: NullPointer exception when
> > trying to add a new JobEntry to the Scheduler service.
> > Dave, did you ever manage to resolve this problem?
> > Regards,
> > Matt
> > --
> >    ____  | Matthew J. Forder         | Data Center Supervisor
> >   / / () | Seagate Techology         | Tel:+31 20 316 7468
> >   \ \ \  | Koolhovenlaan 1           | Fax:+31 20 653 5537
> >  ()_/_/  | 1119 NB Schiphol-Rijk, NL | matthew.forder@seagate.com
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:turbine-user-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:turbine-user-
> > help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>