james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Serge Knystautas" <ser...@lokitech.com>
Subject Re: latest cvs compile but doesn't start up
Date Thu, 13 Sep 2001 01:39:53 GMT
I'm not completely certain of the mysql syntax, so this is what I committed
to CVS...

<sql name="createTable" db="mysql">
        CREATE TABLE ${table} (
         message_name varchar (200) NOT NULL,
         repository_name varchar (200) NOT NULL,
         message_state varchar (30) NOT NULL ,
         error_message varchar (200) NULL ,
         sender varchar (200) NULL ,
         recipients text NOT NULL ,
         remote_host varchar (100) NOT NULL ,
         remote_addr varchar (20) NOT NULL ,
         message_body longblob NOT NULL ,
         last_updated datetime NOT NULL,
         PRIMARY KEY (message, repository_name)
        )
</sql>

Let me know if I did it wrong.  I also corrected the mssql implementation to
set message_name and repository_name as the primary keys.

Would anybody like to pass along the scripts for Oracle, Postgres (if it
supports blobs), Sybase, DB2... any others?  In addition to the create
script, it'd be nice to have the SQL that gets the length (in bytes) of the
message_body field (the blob).

For instance in TSQL (M$SQL) syntax it's...
SELECT datalength(message_body) FROM ${table} WHERE message_name = ? AND
repository_name = ?

and in MySQL it's...
SELECT length(message_body) FROM ${table} WHERE message_name = ? AND
repository_name = ?

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Eung-ju Park" <colus@isoft.co.kr>
To: <james-dev@jakarta.apache.org>
Sent: Tuesday, September 11, 2001 9:17 PM
Subject: Re: latest cvs compile but doesn't start up


>
> ----- Original Message -----
> From: "Gabriel Bucher" <gabriel.bucher@razor.ch>
> To: <james-dev@jakarta.apache.org>
> Sent: Wednesday, September 12, 2001 5:06 AM
> Subject: Re: latest cvs compile but doesn't start up
>
>
> > Serge Knystautas wrote:
> > > It's supposed to have 2 primary keys.
> > >
> > > You need to be able to store a message with the same message_name in
the
> > > same table as it could reside in multiple repositories.  For instance,
> if a
> > > message gets delivered to 2 people with inboxes, they would have the
> same
> > > message name and different repositories (inbox/user1 and inbox/user2)
> > >
> >
> > Ok, that's true.
> > I'm using the 'org.gjt.mm.mysql.Driver' JDBC Driver and get the
> > following exception if james try to create the new table 'message'!
> >
> > java.sql.SQLException: Invalid argument value: Multiple primary key
> defined
> > at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
> > at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
> > at org.gjt.mm.mysql.Connection.execSQL(Connection.java:885)
> > at
org.gjt.mm.mysql.PreparedStatement.execute(PreparedStatement.java:1093)
> > at
> >
>
org.apache.james.mailrepository.JDBCMailRepository.initialize(JDBCMailReposi
> tory.java:251)
> > at
org.apache.james.core.AvalonMailStore.select(AvalonMailStore.java:211)
> > at
> org.apache.james.core.AvalonMailStore.initialize(AvalonMailStore.java:98)
> >
> >
> > What I think, the mysql Driver has a bug or doesn't support his!?!
>
> try
>
> message_name varchar (200) NOT NULL,
> repository_name varchar (200) NOT NULL,
> message_state varchar (30) NOT NULL ,
> error_message varchar (200) NULL ,
> sender varchar (200) NULL ,
> ....
> ....
> PRIMARY KEY (message, repository_name),
> ....
> ....
>
> instead of
>
> message_name varchar (200) NOT NULL PRIMARY KEY,
> repository_name varchar (200) NOT NULL PRIMARY KEY,
> message_state varchar (30) NOT NULL ,
> error_message varchar (200) NULL ,
> sender varchar (200) NULL ,
> ....
> ....



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


Mime
View raw message