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 Serge Knystautas <se...@lokitech.com> on 2001/06/21 06:04:10 UTC

Am I doing something wrong?

I'm having trouble with my spool repository getting instantiated multiple
times.  I've got my (JDBC) repository defined as db://EML_spool/spool, and
this gets defined in 2 places in config.xml... in James' spoolRepository's
repository's destinationURL... and one in the spoolManager's
spoolRepository's repository's destinationURL.  The notes in the XML says
these should match, so this seems right.

However, I'm getting 2 separate instances of the JDBC repository, so when a
message arrives, it can't notify the threads waiting for a message (since
they're waiting on a different instance).  It doesn't seem to do this with
the Avalon repository.

Any ideas on what I'm doing wrong?  Do I need to put some extra methods on
the JDBCSpoolRepository?

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


Re: Am I doing something wrong?

Posted by Serge Knystautas <se...@lokitech.com>.
I can't really control this (or create a singleton) since Avalon/Phoenix is
instantiating the objects.  I guess I'll have to go through that code and
figure out what's going wrong.

On the bright side, the JDBC repository is working other than that.  I think
I have a bug or two to squash, and want to test a mixture of repositories
(like spool repository as JDBC and outgoing repository as file).

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Harmeet" <ha...@kodemuse.com>


> You should not be getting 2 separate instances of JDBC Repository. I think
> that is the key.
> My impression(don't fully remember the code) is that the logic is
> wait-notify so 2 repositories would be bad. (the wait-notify could be bad,
> because it assumes same process)
> You could try making the JDBC Repository a singleton and see if that fixes
> the problem.
>
> Harmeet



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


Re: Am I doing something wrong?

Posted by Harmeet <ha...@kodemuse.com>.
You should not be getting 2 separate instances of JDBC Repository. I think
that is the key.
My impression(don't fully remember the code) is that the logic is
wait-notify so 2 repositories would be bad. (the wait-notify could be bad,
because it assumes same process)
You could try making the JDBC Repository a singleton and see if that fixes
the problem.

Harmeet

----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: <ja...@jakarta.apache.org>
Sent: Wednesday, June 20, 2001 9:04 PM
Subject: Am I doing something wrong?


> I'm having trouble with my spool repository getting instantiated multiple
> times.  I've got my (JDBC) repository defined as db://EML_spool/spool, and
> this gets defined in 2 places in config.xml... in James' spoolRepository's
> repository's destinationURL... and one in the spoolManager's
> spoolRepository's repository's destinationURL.  The notes in the XML says
> these should match, so this seems right.
>
> However, I'm getting 2 separate instances of the JDBC repository, so when
a
> message arrives, it can't notify the threads waiting for a message (since
> they're waiting on a different instance).  It doesn't seem to do this with
> the Avalon repository.
>
> Any ideas on what I'm doing wrong?  Do I need to put some extra methods on
> the JDBCSpoolRepository?
>
> 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
>


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


Re: Am I doing something wrong?

Posted by Charles Benett <ch...@benett1.demon.co.uk>.
Serge Knystautas wrote:
> 
> I'm having trouble with my spool repository getting instantiated multiple
> times.  I've got my (JDBC) repository defined as db://EML_spool/spool, and
> this gets defined in 2 places in config.xml... in James' spoolRepository's
> repository's destinationURL... and one in the spoolManager's
> spoolRepository's repository's destinationURL.  The notes in the XML says
> these should match, so this seems right.

I noticed the double definition the other day, but I don't know where it
came from.

I suspect that is wrong and should be changed.

About to look now.

Charles

> 
> However, I'm getting 2 separate instances of the JDBC repository, so when a
> message arrives, it can't notify the threads waiting for a message (since
> they're waiting on a different instance).  It doesn't seem to do this with
> the Avalon repository.
> 
> Any ideas on what I'm doing wrong?  Do I need to put some extra methods on
> the JDBCSpoolRepository?
> 
> 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

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


Re: Am I doing something wrong?

Posted by Charles Benett <ch...@benett1.demon.co.uk>.
Charles Benett wrote:
> 
> Serge Knystautas wrote:
> >
> > I'm having trouble with my spool repository getting instantiated multiple
> > times.  I've got my (JDBC) repository defined as db://EML_spool/spool, and
> > this gets defined in 2 places in config.xml... in James' spoolRepository's
> > repository's destinationURL... and one in the spoolManager's
> > spoolRepository's repository's destinationURL.  The notes in the XML says
> > these should match, so this seems right.
> >
> > However, I'm getting 2 separate instances of the JDBC repository,
> 
> This is strange. If the destination and type are the same, you should
> only get one instance.  See AvalonMailStore.select().
> 
> It would probably be better to add a getInboundSpool() method to
> interface MailStore and define the spool once in the MailStore block.

I've just done this. 
HTH.
Charles


> 
> Charles
> 
>  so when a
> > message arrives, it can't notify the threads waiting for a message (since
> > they're waiting on a different instance).  It doesn't seem to do this with
> > the Avalon repository.
> >
> > Any ideas on what I'm doing wrong?  Do I need to put some extra methods on
> > the JDBCSpoolRepository?
> >
> > 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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org

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


Re: Am I doing something wrong?

Posted by Charles Benett <ch...@benett1.demon.co.uk>.
Serge Knystautas wrote:
> 
> I'm having trouble with my spool repository getting instantiated multiple
> times.  I've got my (JDBC) repository defined as db://EML_spool/spool, and
> this gets defined in 2 places in config.xml... in James' spoolRepository's
> repository's destinationURL... and one in the spoolManager's
> spoolRepository's repository's destinationURL.  The notes in the XML says
> these should match, so this seems right.
> 
> However, I'm getting 2 separate instances of the JDBC repository,

This is strange. If the destination and type are the same, you should
only get one instance.  See AvalonMailStore.select().

It would probably be better to add a getInboundSpool() method to
interface MailStore and define the spool once in the MailStore block.

Charles


 so when a
> message arrives, it can't notify the threads waiting for a message (since
> they're waiting on a different instance).  It doesn't seem to do this with
> the Avalon repository.
> 
> Any ideas on what I'm doing wrong?  Do I need to put some extra methods on
> the JDBCSpoolRepository?
> 
> 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

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