Mark Woon wrote:
>Leif Mortenson wrote:
>
>>I just went ahead and checked in a JdbcDataSource example that I've had
>>sitting on my computer.
>>
>
>Thanks so much. This is a great help.
>
>>It was not 100% ready for prime time documentation wise, but the example
>>itself is ready. Go into the new examples/jdbcdatasource directory and
>>run build. Then run bin\run.bat (Still need to create a run.sh file)
>>
>
>The build.sh doesn't work if AVALON_HOME isn't set due to problems with the
>relative paths. I've attached a copy of my build.sh that works. It would be
>nice if it could get checked in with execute permissions too.
>
I program on NT. Could someone with Linux please take care of this for
me? Thanks.
Also, if you could write a run.sh file at the same time I would sure
appreciate it :-)
>>>What are my options for the connection-class parameter to
>>>pool-controller (I'm guessing this will be JdbcConnectionPool)?
>>>
>>Actually no, it defaults to
>>"org.apache.avalon.excalibur.datasource.JdbcConnection". I also updated
>>the javadocs, so take a look checkout the latest CVS and take a look at
>>the Javadocs. Go ahead and just leave it off as the default will work.
>>
>
>The Javadoc claims that I can set connection-class to
>"org.apache.avalon.excalibur.datasource.Jdbc3Connection" but there isn't any
>such class. Did you mean JdbcConnection (i.e. no "3")?
>
This is only built if your JVM supports JDBC3. The build checks for a
class called java.sql.Savepoint which odes not exist in JDBC2 and sets
jdbc3.present if it there. Added this to the Javadocs.
>>> What does the keep-alive option do?
>>>
>>It is used for making sure the connection is alive before allowing it to
>>be allocated. See New Javadocs for details. :-)
>>
>
>What happens if the connection is discovered to be dead? Will it be disposed
>off and a new one created?
>
Yes, this will all happen transparently to the caller. Only if a new
connection can not be created will an SQLException be thrown.
>>>Since JdbcConnectionPool implements HardResourceLimitingPool, does this
>>>mean that the number of connections will only grow to the max, and will
>>>never shrink?
>>>
>>That is correct. Take a look at the ResourceLimitingJdbcDataSource in
>>the scratchpad. It will trim unused connections.
>>
>
>Would you consider this ready for production use? Will it be moved over to
>Excalibur proper anytime soon?
>
We are using it in a production system but it is new to the checked in
code for Excalibur. Hopefully it will be after more people have had a
chance to try it and give it their +1
>>Let me know if you still have questions.
>>
>
>Why doesn't JdbcDataSource declare that it implements Configurable?
>
See the implemented interface DataSourceComponent. A little hard to
find, but it does.
---
public interface DataSourceComponent
extends Component, Configurable, ThreadSafe
---
>
>
>Is there a reason you use DefaultConfigurationBuilder.build(FileInputStream) vs
>DefaultConfigurationBuilder.buildFromFile(String)? I'd think the latter would
>save you the trouble of writing the loadConfiguration method.
>
That it would. Fixed and committed.
Cheers,
Leif