You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Serge Knystautas <se...@lokitech.com> on 2001/11/01 23:21:59 UTC

Throttling Excalibur

I've been testing James' database repository code, and it seems to me that
excalibur's datasource is non-blocking (or something strange).  If too many
threads try to get a connection at once, I get the following stack trace:

java.lang.InstantiationException: Ran out of resources to instantiate
 at
org.apache.avalon.excalibur.pool.HardResourceLimitingPool.newPoolable(HardRe
sourceLimitingPool.java:98)
 at
org.apache.avalon.excalibur.datasource.JdbcConnectionPool.newPoolable(JdbcCo
nnectionPool.java:52)
 at
org.apache.avalon.excalibur.pool.AbstractPool.internalGrow(AbstractPool.java
:113)
 at org.apache.avalon.excalibur.pool.DefaultPool.get(DefaultPool.java:125)
 at
org.apache.avalon.excalibur.datasource.JdbcConnectionPool.get(JdbcConnection
Pool.java:76)
 at
org.apache.avalon.excalibur.datasource.JdbcDataSource.getConnection(JdbcData
Source.java:181)
 at
org.apache.james.mailrepository.JDBCMailRepository.getConnection(JDBCMailRep
ository.java:576)

Any ideas?  Ideally if I ask for a connection and I'm at the max number of
connections, it waits and tries again rather than throwing this exception.
I see it's using HardResourceLimitingPool, and so maybe
SoftResourceLimitingPool should be used instead?  Just not sure why hard was
picked and/or the theory behind this connection pooling.

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/


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


Re: Throttling Excalibur

Posted by Serge Knystautas <se...@lokitech.com>.
This is some really really ugly code, but just wanted to share what I was
doing in the meantime to give me a reliable connection.  This is in my app
that's trying to grab a connection from the excalibur datasource.

/**
 * Opens a database connection.
 */
protected Connection getConnection() {
    int attempts = 0;
    while (attempts < 100) {
        try {
            return datasource.getConnection();
        } catch (SQLException e1) {
            if (e1.getMessage().equals("Could not create enough Components
to service your request.")) {
                //at limit
                try {
                    Thread.sleep(50);
                } catch (InterruptedException ie) {
                    //ignore
                }
                attempts++;
            } else {
                throw new CascadingRuntimeException(
                    "An exception occurred getting a database connection.",
e1);
            }
        }
    }
    throw new RuntimeException("Failed to get a connection after " +
attempts + " attempts");
}

Ideally you're not checking the sql exception's message to see if you've hit
the max limit, but Excalibur isn't creating special exception types so not
much choice.  5 seconds may not be enough time, especially if new
connections are being created.

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: "Avalon Developers List" <av...@jakarta.apache.org>
Sent: Friday, November 02, 2001 11:21 AM
Subject: Re: Throttling Excalibur


> ----- Original Message -----
> From: "Berin Loritsch" <bl...@apache.org>
>
>
> > My initial attempts to provide a BlockingHardResourceLimitingPool (i.e.
> one
> > that waits until something is released) resulted in DeadLock in certain
> > circumstances.  This is IMO a bad thing--because once you have deadlock,
> > you can't get ANY more connection objects.
> >
> > For the interim solution, I have opted for the fail early approach.  I
> have
> > not had the time to debug the Blocking version.
>
> I wrote the connection pooler for Town (which is why I originally used it
> for James), so I'll see if the logic used there has any mappings for this
> blocking dilema.
>
> In Town's, I had the pool try to grab a connection 20-100 (?) times,
> sleeping 50ms between attempts.  While trying, if I saw that new
connections
> were being created, I would wait/retry longer since that usually
translates
> into a delay before a connection would be available.
>
> > > On an unrelated note, I see in Jdbc2Connection (and Jdbc3Connection)
> there's
> > > a m_num_uses which seems to cap the number of times a connection is
used
> to
> > > 15.  What's the rationale behind this?  I'd rather go through hundreds
> of
> > > thousands of statements before it's closed...if my SQL is good, it
might
> > > take 1ms to run, and some servers take 1000ms to connect.  So by
capping
> it
> > > to num uses to 15, I've got from 1ms/query to 67ms/query.  Just seems
> like a
> > > weird approach.
> >
> > :)
> >
> > I know it seems to be a weird approach, however I have found in dealing
> with
> > Blobs that most JDBC drivers are buggy.  For instance, if you happen to
> look
> > for a Blob, and receive an exception because you tried to download a
null
> > blob, the Connection is now useless.
>
> Well, I've used Oracle's JDBC driver in the past years, so I can relate to
> JDBC drivers being problematic with BLOBs.  However, I use Inet Software's
> to connect to MS SQL 2K, and I can go days without needing to close a
> connection that's returning almost exclusively blobs.  I would think this
> would be easy to leave as configurable, if not just follow the oradb flag
> and cap the num uses based on that. :)
>
> > Also, if there is some inconsistency in your code where all the JDBC
> objects
> > are not properly closed by your application, you will find that the
> Connection
> > object again becomes unusable.
> >
> > It is exhausting work to audit your own code much less everyone else's.
I
> > could set a flag so that when the Connection produces an Exception, that
> it
> > gets recycled--but that means if your SQL is bad, you get a new
connection
> > everytime you execute it.  Not optimal either.
> >
> > Eventually, I should make this cut-off configurable--but with testing in
> > my environment, the setting I have works for everything.
>
> This is what I did in Town for tracking down in applications where JDBC
> connections weren't closed... when the pool got a connection, I created a
> dummy exception and set it to that conn object, which in your case would
be
> in Jdbc2/3Connection.  If I successfully recycled the connection, I would
> delete the exception.  However, if finally() was called without a recycle,
> this told me the object was gc()'d, and the application wasn't properly
> closing the connection.  So then I could dump/log the stack trace in
> finally(), and presto, I knew where the connection was grabbed and can
track
> down the offending application that wasn't closing the connection.
>
> It actually didn't create as much overhead as you might expect, but you
> could make this configurable (such as a debug flag), so you only create
> these dummy exceptions-for-stack-traces while developing.
>
> > If you have suggestions, patches, example code, etc. I would be more
than
> > happy to evaluate them and incorporate them in the pooling code.
> Eventually,
> > I want to pool the PreparedStatement objects as well (since the JDBC
> driver
> > specs state that it is possible and provides additional performance).
>
> That sounds good too.  Although I'm still just trying to hoping to get
> Excalibur reliable enough so that I don't have to call jdbc-support
experime
> ntal in James, so performance optimizations are secondary to me for now.
>
> Serge Knystautas
> Loki Technologies  - Unstoppable Websites
> http://www.lokitech.com/



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


Re: Throttling Excalibur

Posted by Serge Knystautas <se...@lokitech.com>.
----- Original Message -----
From: "Berin Loritsch" <bl...@apache.org>


> My initial attempts to provide a BlockingHardResourceLimitingPool (i.e.
one
> that waits until something is released) resulted in DeadLock in certain
> circumstances.  This is IMO a bad thing--because once you have deadlock,
> you can't get ANY more connection objects.
>
> For the interim solution, I have opted for the fail early approach.  I
have
> not had the time to debug the Blocking version.

I wrote the connection pooler for Town (which is why I originally used it
for James), so I'll see if the logic used there has any mappings for this
blocking dilema.

In Town's, I had the pool try to grab a connection 20-100 (?) times,
sleeping 50ms between attempts.  While trying, if I saw that new connections
were being created, I would wait/retry longer since that usually translates
into a delay before a connection would be available.

> > On an unrelated note, I see in Jdbc2Connection (and Jdbc3Connection)
there's
> > a m_num_uses which seems to cap the number of times a connection is used
to
> > 15.  What's the rationale behind this?  I'd rather go through hundreds
of
> > thousands of statements before it's closed...if my SQL is good, it might
> > take 1ms to run, and some servers take 1000ms to connect.  So by capping
it
> > to num uses to 15, I've got from 1ms/query to 67ms/query.  Just seems
like a
> > weird approach.
>
> :)
>
> I know it seems to be a weird approach, however I have found in dealing
with
> Blobs that most JDBC drivers are buggy.  For instance, if you happen to
look
> for a Blob, and receive an exception because you tried to download a null
> blob, the Connection is now useless.

Well, I've used Oracle's JDBC driver in the past years, so I can relate to
JDBC drivers being problematic with BLOBs.  However, I use Inet Software's
to connect to MS SQL 2K, and I can go days without needing to close a
connection that's returning almost exclusively blobs.  I would think this
would be easy to leave as configurable, if not just follow the oradb flag
and cap the num uses based on that. :)

> Also, if there is some inconsistency in your code where all the JDBC
objects
> are not properly closed by your application, you will find that the
Connection
> object again becomes unusable.
>
> It is exhausting work to audit your own code much less everyone else's.  I
> could set a flag so that when the Connection produces an Exception, that
it
> gets recycled--but that means if your SQL is bad, you get a new connection
> everytime you execute it.  Not optimal either.
>
> Eventually, I should make this cut-off configurable--but with testing in
> my environment, the setting I have works for everything.

This is what I did in Town for tracking down in applications where JDBC
connections weren't closed... when the pool got a connection, I created a
dummy exception and set it to that conn object, which in your case would be
in Jdbc2/3Connection.  If I successfully recycled the connection, I would
delete the exception.  However, if finally() was called without a recycle,
this told me the object was gc()'d, and the application wasn't properly
closing the connection.  So then I could dump/log the stack trace in
finally(), and presto, I knew where the connection was grabbed and can track
down the offending application that wasn't closing the connection.

It actually didn't create as much overhead as you might expect, but you
could make this configurable (such as a debug flag), so you only create
these dummy exceptions-for-stack-traces while developing.

> If you have suggestions, patches, example code, etc. I would be more than
> happy to evaluate them and incorporate them in the pooling code.
Eventually,
> I want to pool the PreparedStatement objects as well (since the JDBC
driver
> specs state that it is possible and provides additional performance).

That sounds good too.  Although I'm still just trying to hoping to get
Excalibur reliable enough so that I don't have to call jdbc-support experime
ntal in James, so performance optimizations are secondary to me for now.

Serge Knystautas
Loki Technologies  - Unstoppable Websites
http://www.lokitech.com/


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


Re: Throttling Excalibur

Posted by Berin Loritsch <bl...@apache.org>.
Leo Sutic wrote:
> 
> > -----Original Message-----
> > From: Berin Loritsch [mailto:bloritsch@apache.org]
> > Sent: den 2 november 2001 16:50
> > To: Avalon Developers List
> > Subject: Re: Throttling Excalibur
> >
> > My initial attempts to provide a BlockingHardResourceLimitingPool
> > (i.e. one
> > that waits until something is released) resulted in DeadLock in certain
> > circumstances.  This is IMO a bad thing--because once you have deadlock,
> > you can't get ANY more connection objects.
> 
> Hmmm... It looks like something the DjikstraSemaphore class could be used
> for. Use semaphore.aquire() in get() and semaphore.release() in put(). This,
> of course, means that each thread can only aquire one instance from the
> pool, to prevent deadlock. Is there a way to recognize when a thread has
> taken two items out of the pool and optionally throw an exception in that
> case?
> 
> Berin, I'd be quite happy to take a look at whatever code it is you have for
> the blocking pool, along with the test cases (if any).

The last time I tried it, was before our concurrency tools were as robust as
they are now.  I committed some changes to conditionally allow blocking behavior.
There are two options:  NonBlocking (fail hard/fast), and Blocking with a
timeout.  It is dangerous to allow a system to block without a timeout, or
you will be in deadlock.  Therefore if the "timeout" attribute of the
"pool-controller" element is above 0, we will wait that long until we are
woken up by a poolable object being returned.

-- 

"Those who would trade liberty for
 temporary security deserve neither"
                - Benjamin Franklin

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


RE: Throttling Excalibur

Posted by Leo Sutic <le...@inspireinfrastructure.com>.

> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: den 2 november 2001 16:50
> To: Avalon Developers List
> Subject: Re: Throttling Excalibur
>
> My initial attempts to provide a BlockingHardResourceLimitingPool
> (i.e. one
> that waits until something is released) resulted in DeadLock in certain
> circumstances.  This is IMO a bad thing--because once you have deadlock,
> you can't get ANY more connection objects.

Hmmm... It looks like something the DjikstraSemaphore class could be used
for. Use semaphore.aquire() in get() and semaphore.release() in put(). This,
of course, means that each thread can only aquire one instance from the
pool, to prevent deadlock. Is there a way to recognize when a thread has
taken two items out of the pool and optionally throw an exception in that
case?

Berin, I'd be quite happy to take a look at whatever code it is you have for
the blocking pool, along with the test cases (if any).

/LS


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


Re: Throttling Excalibur

Posted by Berin Loritsch <bl...@apache.org>.
Serge Knystautas wrote:
> 
> ----- Original Message -----
> From: "giacomo" <gi...@apache.org>
> 
> > The HardResourceLimitingPool was choosen because of licensing issues you
> > might run into when creating more connection than you've licensed. This
> > way you can be sure you want run into illegality ;)
> 
> Ok sure, illegality is a bad thing.
> 
> I guess I have different a expectation of a datasource.  I'm used to a
> temporary unavailability being handled by the connection pooler, not by the
> application.  Are there other connection poolers out there that offer this
> unreliability?

My initial attempts to provide a BlockingHardResourceLimitingPool (i.e. one
that waits until something is released) resulted in DeadLock in certain
circumstances.  This is IMO a bad thing--because once you have deadlock,
you can't get ANY more connection objects.

For the interim solution, I have opted for the fail early approach.  I have
not had the time to debug the Blocking version.

> On an unrelated note, I see in Jdbc2Connection (and Jdbc3Connection) there's
> a m_num_uses which seems to cap the number of times a connection is used to
> 15.  What's the rationale behind this?  I'd rather go through hundreds of
> thousands of statements before it's closed...if my SQL is good, it might
> take 1ms to run, and some servers take 1000ms to connect.  So by capping it
> to num uses to 15, I've got from 1ms/query to 67ms/query.  Just seems like a
> weird approach.

:)

I know it seems to be a weird approach, however I have found in dealing with
Blobs that most JDBC drivers are buggy.  For instance, if you happen to look
for a Blob, and receive an exception because you tried to download a null
blob, the Connection is now useless.

Also, if there is some inconsistency in your code where all the JDBC objects
are not properly closed by your application, you will find that the Connection
object again becomes unusable.

It is exhausting work to audit your own code much less everyone else's.  I
could set a flag so that when the Connection produces an Exception, that it
gets recycled--but that means if your SQL is bad, you get a new connection
everytime you execute it.  Not optimal either.

Eventually, I should make this cut-off configurable--but with testing in
my environment, the setting I have works for everything.

If you have suggestions, patches, example code, etc. I would be more than
happy to evaluate them and incorporate them in the pooling code.  Eventually,
I want to pool the PreparedStatement objects as well (since the JDBC driver
specs state that it is possible and provides additional performance).

> 
> Serge Knystautas
> Loki Technologies - Unstoppable Websites
> http://www.lokitech.com/
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


-- 

"Those who would trade liberty for
 temporary security deserve neither"
                - Benjamin Franklin

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


Re: Throttling Excalibur

Posted by Serge Knystautas <se...@lokitech.com>.
----- Original Message -----
From: "giacomo" <gi...@apache.org>


> The HardResourceLimitingPool was choosen because of licensing issues you
> might run into when creating more connection than you've licensed. This
> way you can be sure you want run into illegality ;)

Ok sure, illegality is a bad thing.

I guess I have different a expectation of a datasource.  I'm used to a
temporary unavailability being handled by the connection pooler, not by the
application.  Are there other connection poolers out there that offer this
unreliability?

On an unrelated note, I see in Jdbc2Connection (and Jdbc3Connection) there's
a m_num_uses which seems to cap the number of times a connection is used to
15.  What's the rationale behind this?  I'd rather go through hundreds of
thousands of statements before it's closed...if my SQL is good, it might
take 1ms to run, and some servers take 1000ms to connect.  So by capping it
to num uses to 15, I've got from 1ms/query to 67ms/query.  Just seems like a
weird approach.

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/


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


Re: docbook, fo and cocoon2

Posted by Vincent Massol <vm...@octo.com>.

----- Original Message -----
From: "Berin Loritsch" <bl...@apache.org>
To: "Avalon Developers List" <av...@jakarta.apache.org>
Sent: Friday, November 02, 2001 3:04 PM
Subject: Re: docbook, fo and cocoon2


> Vincent Massol wrote:
> >
> > > The stylesheet is supposed to be able to convert from DocBook's notion
of
> > > widths to FO.  In fact, the conversion XSL came from the XSL:FO spec.
Use
> > > the '*' notation for proportional widths.  I.e. for one column to be
1/3
> > > the width and the other column to be 2/3 the total width, you would
use
> > this:
> > >
> > > <column width="*"/>
> > > <column width="2*"/>
> > >
> > > The stylesheet will take care of the rest.
> > >
> >
> > yes, I agree but what I was saying is that it doesn't seem to work ...
some
> > recursive error happens ... Have you tried it ?
>
> No.  Can you provide a detailed error report?

doc:
     [java] Cannot find CatalogManager.properties
     [java] Cannot find CatalogManager.properties
     [java] Cannot find CatalogManager.properties
     [java] Cannot find CatalogManager.properties
     [java] Cannot find CatalogManager.properties
     [java] ERROR   10047   [fop     ] (): Unknown formatting object
http://www.w3.org/1999/XSL/Form
at^simple-link
     [java] ERROR   10047   [fop     ] (): >
     [java] ERROR   10047   [fop     ] (): >
     [java] ERROR   10047   [fop     ] (): >
     [java] ERROR   10047   [fop     ] (): >
     [java] ERROR   10047   [fop     ] (): >
     [java] ERROR   10047   [fop     ] (): >
     [java] ERROR   10047   [fop     ] (): >
... (repeat an infinite number of times) ...

>
> > > > Also, do you know if fop supports <simple-link> (what <ulink> is
> > transformed
> > > > into). Fop gives the following error :
> > > >
> > > >      [java] ERROR   10047   [fop     ] (): Unknown formatting object
> > > > http://www.w3.org/1999/XSL/Format^simple-link
>
> I am not sure.  I assumed it would work, and found that it doesn't.  I
just
> haven't had the time to deal with it.

I have seen your bug report but no answer yet ...

>
> > > > Thanks for your help.
> > > >
> > > > Do you know how to debug cocoon2 (see the text in my first post) ?
>
> "Also, is there a cocoon flag to turn on so that I can see the
intermediate
> generated files (like the xml file resulting from the docbook2fo.xsl
> transformation) ? I know this is a cocoon question but you may have used
it"
>
> There is a LogTransformer that will send all the SAX events to a file of
your
> choosing.  You can then figure out what is going on from there.
>
> Alternatively, you can specify URLs that give you the pure XML results of
> each step.  IOW, instead of xx.pdf, you would use xx.xml, xx-fo.xml, etc.
>

thanks
-Vincent

> --
>
> "Those who would trade liberty for
>  temporary security deserve neither"
>                 - Benjamin Franklin
>
> --
> 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>


Re: docbook, fo and cocoon2

Posted by Berin Loritsch <bl...@apache.org>.
Vincent Massol wrote:
> 
> > The stylesheet is supposed to be able to convert from DocBook's notion of
> > widths to FO.  In fact, the conversion XSL came from the XSL:FO spec.  Use
> > the '*' notation for proportional widths.  I.e. for one column to be 1/3
> > the width and the other column to be 2/3 the total width, you would use
> this:
> >
> > <column width="*"/>
> > <column width="2*"/>
> >
> > The stylesheet will take care of the rest.
> >
> 
> yes, I agree but what I was saying is that it doesn't seem to work ... some
> recursive error happens ... Have you tried it ?

No.  Can you provide a detailed error report?

> > > Also, do you know if fop supports <simple-link> (what <ulink> is
> transformed
> > > into). Fop gives the following error :
> > >
> > >      [java] ERROR   10047   [fop     ] (): Unknown formatting object
> > > http://www.w3.org/1999/XSL/Format^simple-link

I am not sure.  I assumed it would work, and found that it doesn't.  I just
haven't had the time to deal with it.

> > > Thanks for your help.
> > >
> > > Do you know how to debug cocoon2 (see the text in my first post) ?

"Also, is there a cocoon flag to turn on so that I can see the intermediate
generated files (like the xml file resulting from the docbook2fo.xsl
transformation) ? I know this is a cocoon question but you may have used it"

There is a LogTransformer that will send all the SAX events to a file of your
choosing.  You can then figure out what is going on from there.

Alternatively, you can specify URLs that give you the pure XML results of
each step.  IOW, instead of xx.pdf, you would use xx.xml, xx-fo.xml, etc.

-- 

"Those who would trade liberty for
 temporary security deserve neither"
                - Benjamin Franklin

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


Re: docbook, fo and cocoon2

Posted by Vincent Massol <vm...@octo.com>.

----- Original Message -----
From: "Berin Loritsch" <bl...@apache.org>
To: "Avalon Developers List" <av...@jakarta.apache.org>
Sent: Friday, November 02, 2001 2:44 PM
Subject: Re: docbook, fo and cocoon2


> Vincent Massol wrote:
> >
> > Thanks Berin,
> >
> > I had come to that conclusion after reading a bit more on the fop web
site.
> > I have modified the stylesheet to automatically include fo:block. I
still
> > have a problem with specifying column width using 'number*' format (it
works
> > with '200pt', i.e. fixed size). It seems the stylesheet does not work
for
> > proprtional values.
>
> The stylesheet is supposed to be able to convert from DocBook's notion of
> widths to FO.  In fact, the conversion XSL came from the XSL:FO spec.  Use
> the '*' notation for proportional widths.  I.e. for one column to be 1/3
> the width and the other column to be 2/3 the total width, you would use
this:
>
> <column width="*"/>
> <column width="2*"/>
>
> The stylesheet will take care of the rest.
>

yes, I agree but what I was saying is that it doesn't seem to work ... some
recursive error happens ... Have you tried it ?

> >
> > Also, do you know if fop supports <simple-link> (what <ulink> is
transformed
> > into). Fop gives the following error :
> >
> >      [java] ERROR   10047   [fop     ] (): Unknown formatting object
> > http://www.w3.org/1999/XSL/Format^simple-link
> >

??


> > Thanks for your help.
> >
> > Do you know how to debug cocoon2 (see the text in my first post) ?

??

thanks
-Vincent

> >
> > Cheers,
> > -Vincent
> >
> > ----- Original Message -----
> > From: "Berin Loritsch" <bl...@apache.org>
> > To: "Avalon Developers List" <av...@jakarta.apache.org>
> > Sent: Friday, November 02, 2001 1:44 PM
> > Subject: Re: docbook, fo and cocoon2
> >
> > > Vincent Massol wrote:
> > > >
> > > > Hi,
> > > >
> > > > I have copied your settings and stylesheets that you use in Avalon
to
> > > > generate the documentation (especially the PDF part). Thanks very
much
> > for
> > > > that ! I have it working except for generating tables in PDF.
> > Unfortunately,
> > > > there are no tables in the "developing with avalon" XML source so I
> > cannot
> > > > copy a working example ... :)
> > > >
> > > > The generating in HTML works fine (i.e. docbook2body.xsl). However
the
> > > > generation to PDF does not print anything (docbook2fo.xsl) ... Have
you
> > had
> > > > any success with this ?
> > > >
> > > > Also, is there a cocoon flag to turn on so that I can see the
> > intermediate
> > > > generated files (like the xml file resulting from the docbook2fo.xsl
> > > > transformation) ? I know this is a cocoon question but you may have
used
> > it
> > > > ...
> > > >
> > > > Here is my table definition :
> > > >
> > > >       <table>
> > > >         <tgroup cols="2">
> > > >           <colspec colname="c1"/>
> > > >           <colspec colname="c2"/>
> > > >           <tbody>
> > > >             <row>
> > > >               <entry>xxx</entry>
> > > >               <entry>xxx</entry>
> > > >             </row>
> > > >           </tbody>
> > > >         </tgroup>
> > > >      </ltable>
> > >
> > > FOP has some limitations that force some markup constraints in
> > > the table.  One of them is that you have to specify width in
> > > the colspec.  The other is that all your information must be
> > > in an enclosing <fo:block/> element.  Therefore, inside your
> > > markup you may want to do something like this:
> > >
> > > <row>
> > >   <entry><para>xxx</para></entry>
> > >   <entry><para>xxx</para></entry>
> > > </row>
> > >
> > > I may have to change the stylesheet to automatically insert the
> > > blocks for me.
> > > >
> > > > Thanks for any help
> > > > -Vincent
> > > >
> > > > Note: At some point we will need to create a jakarta project that
would
> > > > contain all the docbook stylesheets for the Jakarta style ...
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> > >
> > > --
> > >
> > > "Those who would trade liberty for
> > >  temporary security deserve neither"
> > >                 - Benjamin Franklin
> > >
> > > --
> > > 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>
>
>
> --
>
> "Those who would trade liberty for
>  temporary security deserve neither"
>                 - Benjamin Franklin
>
> --
> 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>


Re: docbook, fo and cocoon2

Posted by Berin Loritsch <bl...@apache.org>.
Vincent Massol wrote:
> 
> Thanks Berin,
> 
> I had come to that conclusion after reading a bit more on the fop web site.
> I have modified the stylesheet to automatically include fo:block. I still
> have a problem with specifying column width using 'number*' format (it works
> with '200pt', i.e. fixed size). It seems the stylesheet does not work for
> proprtional values.

The stylesheet is supposed to be able to convert from DocBook's notion of
widths to FO.  In fact, the conversion XSL came from the XSL:FO spec.  Use
the '*' notation for proportional widths.  I.e. for one column to be 1/3
the width and the other column to be 2/3 the total width, you would use this:

<column width="*"/>
<column width="2*"/>

The stylesheet will take care of the rest.

> 
> Also, do you know if fop supports <simple-link> (what <ulink> is transformed
> into). Fop gives the following error :
> 
>      [java] ERROR   10047   [fop     ] (): Unknown formatting object
> http://www.w3.org/1999/XSL/Format^simple-link
> 
> Thanks for your help.
> 
> Do you know how to debug cocoon2 (see the text in my first post) ?
> 
> Cheers,
> -Vincent
> 
> ----- Original Message -----
> From: "Berin Loritsch" <bl...@apache.org>
> To: "Avalon Developers List" <av...@jakarta.apache.org>
> Sent: Friday, November 02, 2001 1:44 PM
> Subject: Re: docbook, fo and cocoon2
> 
> > Vincent Massol wrote:
> > >
> > > Hi,
> > >
> > > I have copied your settings and stylesheets that you use in Avalon to
> > > generate the documentation (especially the PDF part). Thanks very much
> for
> > > that ! I have it working except for generating tables in PDF.
> Unfortunately,
> > > there are no tables in the "developing with avalon" XML source so I
> cannot
> > > copy a working example ... :)
> > >
> > > The generating in HTML works fine (i.e. docbook2body.xsl). However the
> > > generation to PDF does not print anything (docbook2fo.xsl) ... Have you
> had
> > > any success with this ?
> > >
> > > Also, is there a cocoon flag to turn on so that I can see the
> intermediate
> > > generated files (like the xml file resulting from the docbook2fo.xsl
> > > transformation) ? I know this is a cocoon question but you may have used
> it
> > > ...
> > >
> > > Here is my table definition :
> > >
> > >       <table>
> > >         <tgroup cols="2">
> > >           <colspec colname="c1"/>
> > >           <colspec colname="c2"/>
> > >           <tbody>
> > >             <row>
> > >               <entry>xxx</entry>
> > >               <entry>xxx</entry>
> > >             </row>
> > >           </tbody>
> > >         </tgroup>
> > >      </ltable>
> >
> > FOP has some limitations that force some markup constraints in
> > the table.  One of them is that you have to specify width in
> > the colspec.  The other is that all your information must be
> > in an enclosing <fo:block/> element.  Therefore, inside your
> > markup you may want to do something like this:
> >
> > <row>
> >   <entry><para>xxx</para></entry>
> >   <entry><para>xxx</para></entry>
> > </row>
> >
> > I may have to change the stylesheet to automatically insert the
> > blocks for me.
> > >
> > > Thanks for any help
> > > -Vincent
> > >
> > > Note: At some point we will need to create a jakarta project that would
> > > contain all the docbook stylesheets for the Jakarta style ...
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
> > --
> >
> > "Those who would trade liberty for
> >  temporary security deserve neither"
> >                 - Benjamin Franklin
> >
> > --
> > 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>


-- 

"Those who would trade liberty for
 temporary security deserve neither"
                - Benjamin Franklin

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


Re: docbook, fo and cocoon2

Posted by Vincent Massol <vm...@octo.com>.
Thanks Berin,

I had come to that conclusion after reading a bit more on the fop web site.
I have modified the stylesheet to automatically include fo:block. I still
have a problem with specifying column width using 'number*' format (it works
with '200pt', i.e. fixed size). It seems the stylesheet does not work for
proprtional values.

Also, do you know if fop supports <simple-link> (what <ulink> is transformed
into). Fop gives the following error :

     [java] ERROR   10047   [fop     ] (): Unknown formatting object
http://www.w3.org/1999/XSL/Format^simple-link

Thanks for your help.

Do you know how to debug cocoon2 (see the text in my first post) ?

Cheers,
-Vincent

----- Original Message -----
From: "Berin Loritsch" <bl...@apache.org>
To: "Avalon Developers List" <av...@jakarta.apache.org>
Sent: Friday, November 02, 2001 1:44 PM
Subject: Re: docbook, fo and cocoon2


> Vincent Massol wrote:
> >
> > Hi,
> >
> > I have copied your settings and stylesheets that you use in Avalon to
> > generate the documentation (especially the PDF part). Thanks very much
for
> > that ! I have it working except for generating tables in PDF.
Unfortunately,
> > there are no tables in the "developing with avalon" XML source so I
cannot
> > copy a working example ... :)
> >
> > The generating in HTML works fine (i.e. docbook2body.xsl). However the
> > generation to PDF does not print anything (docbook2fo.xsl) ... Have you
had
> > any success with this ?
> >
> > Also, is there a cocoon flag to turn on so that I can see the
intermediate
> > generated files (like the xml file resulting from the docbook2fo.xsl
> > transformation) ? I know this is a cocoon question but you may have used
it
> > ...
> >
> > Here is my table definition :
> >
> >       <table>
> >         <tgroup cols="2">
> >           <colspec colname="c1"/>
> >           <colspec colname="c2"/>
> >           <tbody>
> >             <row>
> >               <entry>xxx</entry>
> >               <entry>xxx</entry>
> >             </row>
> >           </tbody>
> >         </tgroup>
> >      </ltable>
>
> FOP has some limitations that force some markup constraints in
> the table.  One of them is that you have to specify width in
> the colspec.  The other is that all your information must be
> in an enclosing <fo:block/> element.  Therefore, inside your
> markup you may want to do something like this:
>
> <row>
>   <entry><para>xxx</para></entry>
>   <entry><para>xxx</para></entry>
> </row>
>
> I may have to change the stylesheet to automatically insert the
> blocks for me.
> >
> > Thanks for any help
> > -Vincent
> >
> > Note: At some point we will need to create a jakarta project that would
> > contain all the docbook stylesheets for the Jakarta style ...
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
> --
>
> "Those who would trade liberty for
>  temporary security deserve neither"
>                 - Benjamin Franklin
>
> --
> 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>


Re: docbook, fo and cocoon2

Posted by Berin Loritsch <bl...@apache.org>.
Vincent Massol wrote:
> 
> Hi,
> 
> I have copied your settings and stylesheets that you use in Avalon to
> generate the documentation (especially the PDF part). Thanks very much for
> that ! I have it working except for generating tables in PDF. Unfortunately,
> there are no tables in the "developing with avalon" XML source so I cannot
> copy a working example ... :)
> 
> The generating in HTML works fine (i.e. docbook2body.xsl). However the
> generation to PDF does not print anything (docbook2fo.xsl) ... Have you had
> any success with this ?
> 
> Also, is there a cocoon flag to turn on so that I can see the intermediate
> generated files (like the xml file resulting from the docbook2fo.xsl
> transformation) ? I know this is a cocoon question but you may have used it
> ...
> 
> Here is my table definition :
> 
>       <table>
>         <tgroup cols="2">
>           <colspec colname="c1"/>
>           <colspec colname="c2"/>
>           <tbody>
>             <row>
>               <entry>xxx</entry>
>               <entry>xxx</entry>
>             </row>
>           </tbody>
>         </tgroup>
>      </ltable>

FOP has some limitations that force some markup constraints in
the table.  One of them is that you have to specify width in
the colspec.  The other is that all your information must be
in an enclosing <fo:block/> element.  Therefore, inside your
markup you may want to do something like this:

<row>
  <entry><para>xxx</para></entry>
  <entry><para>xxx</para></entry>
</row>

I may have to change the stylesheet to automatically insert the
blocks for me.
> 
> Thanks for any help
> -Vincent
> 
> Note: At some point we will need to create a jakarta project that would
> contain all the docbook stylesheets for the Jakarta style ...
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


-- 

"Those who would trade liberty for
 temporary security deserve neither"
                - Benjamin Franklin

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


docbook, fo and cocoon2

Posted by Vincent Massol <vm...@octo.com>.
Hi,

I have copied your settings and stylesheets that you use in Avalon to
generate the documentation (especially the PDF part). Thanks very much for
that ! I have it working except for generating tables in PDF. Unfortunately,
there are no tables in the "developing with avalon" XML source so I cannot
copy a working example ... :)

The generating in HTML works fine (i.e. docbook2body.xsl). However the
generation to PDF does not print anything (docbook2fo.xsl) ... Have you had
any success with this ?

Also, is there a cocoon flag to turn on so that I can see the intermediate
generated files (like the xml file resulting from the docbook2fo.xsl
transformation) ? I know this is a cocoon question but you may have used it
...

Here is my table definition :

      <table>
        <tgroup cols="2">
          <colspec colname="c1"/>
          <colspec colname="c2"/>
          <tbody>
            <row>
              <entry>xxx</entry>
              <entry>xxx</entry>
            </row>
          </tbody>
        </tgroup>
     </ltable>

Thanks for any help
-Vincent

Note: At some point we will need to create a jakarta project that would
contain all the docbook stylesheets for the Jakarta style ...



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


Re: Throttling Excalibur

Posted by giacomo <gi...@apache.org>.
On Thu, 1 Nov 2001, Serge Knystautas wrote:

> I've been testing James' database repository code, and it seems to me that
> excalibur's datasource is non-blocking (or something strange).  If too many
> threads try to get a connection at once, I get the following stack trace:
>
> java.lang.InstantiationException: Ran out of resources to instantiate
>  at
> org.apache.avalon.excalibur.pool.HardResourceLimitingPool.newPoolable(HardRe
> sourceLimitingPool.java:98)
>  at
> org.apache.avalon.excalibur.datasource.JdbcConnectionPool.newPoolable(JdbcCo
> nnectionPool.java:52)
>  at
> org.apache.avalon.excalibur.pool.AbstractPool.internalGrow(AbstractPool.java
> :113)
>  at org.apache.avalon.excalibur.pool.DefaultPool.get(DefaultPool.java:125)
>  at
> org.apache.avalon.excalibur.datasource.JdbcConnectionPool.get(JdbcConnection
> Pool.java:76)
>  at
> org.apache.avalon.excalibur.datasource.JdbcDataSource.getConnection(JdbcData
> Source.java:181)
>  at
> org.apache.james.mailrepository.JDBCMailRepository.getConnection(JDBCMailRep
> ository.java:576)
>
> Any ideas?  Ideally if I ask for a connection and I'm at the max number of
> connections, it waits and tries again rather than throwing this exception.
> I see it's using HardResourceLimitingPool, and so maybe
> SoftResourceLimitingPool should be used instead?  Just not sure why hard was
> picked and/or the theory behind this connection pooling.

The HardResourceLimitingPool was choosen because of licensing issues you
might run into when creating more connection than you've licensed. This
way you can be sure you want run into illegality ;)

Giacomo


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