You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Oki DZ <ok...@pindad.com> on 2001/08/03 08:51:35 UTC

MailImpl (was: Re: cvs commit: jakarta-james/src/conf spool.properties)

On 3 Aug 2001 serge@apache.org wrote:

>    listMessagesSQL=SELECT message_name, message_state, last_updated FROM
> <table> WHERE repository_name = ? ORDER BY last_updated ASC
  
In MailImpl class, the lastUpdated field is intialized with the current
date:
    private Date lastUpdated = new Date();  

In MySQL, when the message is stored, the content of the last_updated
column will be just the date, without the current time (the time is set to
zeros). I think it would be better if the store() method in
JDBCMailRepository uses java.sql.Timestamp, so that when the message is
stored, the time will be included. By doing so, the above SQL statement
would be more useful. The current implementation would make the order of
the messages to be not quite precise; the messages that are sent during
the day would be regarded to have the same sort order. The exact order
(the order of the messages retrieved) would be database implementation
spesific I guess.

Oki



---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: MailImpl (was: Re: cvs commit: jakarta-james/src/conf spool.properties)

Posted by Serge Knystautas <se...@lokitech.com>.
Ok, it's patched.  There were actually a few places where I was incorrectly
using java.sql.Date instead of java.sql.Timestamp.  Let me know how it works
for you now.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
To: <ja...@jakarta.apache.org>
Cc: <ja...@apache.org>
Sent: Friday, August 03, 2001 2:51 AM
Subject: MailImpl (was: Re: cvs commit: jakarta-james/src/conf
spool.properties)


> On 3 Aug 2001 serge@apache.org wrote:
>
> >    listMessagesSQL=SELECT message_name, message_state, last_updated FROM
> > <table> WHERE repository_name = ? ORDER BY last_updated ASC
>
> In MailImpl class, the lastUpdated field is intialized with the current
> date:
>     private Date lastUpdated = new Date();
>
> In MySQL, when the message is stored, the content of the last_updated
> column will be just the date, without the current time (the time is set to
> zeros). I think it would be better if the store() method in
> JDBCMailRepository uses java.sql.Timestamp, so that when the message is
> stored, the time will be included. By doing so, the above SQL statement
> would be more useful. The current implementation would make the order of
> the messages to be not quite precise; the messages that are sent during
> the day would be regarded to have the same sort order. The exact order
> (the order of the messages retrieved) would be database implementation
> spesific I guess.
>
> Oki
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>
----------------------------------------------------
This message was brought to you by MailHive.net

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: MailImpl (was: Re: cvs commit: jakarta-james/src/conf spool.properties)

Posted by Charles Benett <ch...@benett1.demon.co.uk>.
Oki DZ wrote:
> 
> On 3 Aug 2001 serge@apache.org wrote:
> 
> >    listMessagesSQL=SELECT message_name, message_state, last_updated FROM
> > <table> WHERE repository_name = ? ORDER BY last_updated ASC
> 
> In MailImpl class, the lastUpdated field is intialized with the current
> date:
>     private Date lastUpdated = new Date();
> 
> In MySQL, when the message is stored, the content of the last_updated
> column will be just the date, without the current time (the time is set to
> zeros). I think it would be better if the store() method in
> JDBCMailRepository uses java.sql.Timestamp, so that when the message is
> stored, the time will be included. By doing so, the above SQL statement
> would be more useful. The current implementation would make the order of
> the messages to be not quite precise; the messages that are sent during
> the day would be regarded to have the same sort order. The exact order
> (the order of the messages retrieved) would be database implementation
> spesific I guess.
> 
> Oki


Send a patch.
Ie change the class, test it, use cvs diff -u and email the diff output
in the body of an email to the list.
 
Charles

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: [PATCH] for Bug 2461

Posted by Serge Knystautas <se...@lokitech.com>.
----- Original Message -----
From: "Gabriel Bucher" <ga...@razor.ch>
> I tried different ways for mail addresses:
> - a      -> StringIndexOutOfBoundsException
> - a@     -> StringIndexOutOfBoundsException
> - a@b    -> OK
> - a@b.   -> StringIndexOutOfBoundsException
> - a@b.c  -> OK

Thanks for the patch!  I'll apply it later.  You're very correct that they
should be throwing ParseExceptions, not StringIndexOutOfBoundsException.

> Question:
> Is 'a@b.c.' a correct mail address?

No.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


[PATCH] for Bug 2461

Posted by Gabriel Bucher <ga...@razor.ch>.
I had simular problems...

I tried different ways for mail addresses:
- a      -> StringIndexOutOfBoundsException
- a@     -> StringIndexOutOfBoundsException
- a@b    -> OK
- a@b.   -> StringIndexOutOfBoundsException
- a@b.c  -> OK

The following small patch will throw a ParseException instead of a
uncatched StringIndexOutOfBoundsException!

Question:
Is 'a@b.c.' a correct mail address?

Buchi

Re: MailImpl (was: Re: cvs commit: jakarta-james/src/conf spool.properties)

Posted by Serge Knystautas <se...@lokitech.com>.
Have you tested this?  I'll try this with my MS driver.  It's not a
java.sql.Date, so it should have the same resolution as the Timestamp.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
To: <ja...@jakarta.apache.org>
Sent: Friday, August 03, 2001 3:10 AM
Subject: Re: MailImpl (was: Re: cvs commit: jakarta-james/src/conf
spool.properties)


> Hi,
>
> Having
> private lastUpdated = new Timestamp(System.currentTimeMillis());
> would be needed. It would be more appropriate, I think.
>
> Oki
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>
----------------------------------------------------
This message was brought to you by MailHive.net

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: MailImpl (was: Re: cvs commit: jakarta-james/src/conf spool.properties)

Posted by Oki DZ <ok...@pindad.com>.
Hi, 

Having 
private lastUpdated = new Timestamp(System.currentTimeMillis());
would be needed. It would be more appropriate, I think.

Oki





---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org