| Issue 13: | support JNDI lookups for backends | |
| 3 people starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
This is really low hanging fruit. We should support JNDI lookups when creating database connections. When deploying Django apps into a j2ee container, this will enable administrators to configure connection pooling parameters. We can add two extra parameters into settings.py : DATABASE_JNDI_NAME and DATABASE_JNDI_FALLBACK. The JNDI name will be used to do the JNDI lookup and the FALLBACK setting can be set to allow the backend to fallback to regular 'direct' connections to the databse in the event that JNDI is not available. This will facilitate one set of settings for development deployments. When doing a production deployment, the FALLBACK setting can be set to False so that JNDI is always used. |
||||||||||||
,
Jul 27, 2009
I agree we need to support it out of the box. My only (really minor) observation would be to define entries in the DATABASE_OPTIONS dictionary instead of creating new settings entries which is what other third-party backends do. as far as I've seen.
Labels: Milestone-Release1.0
|
|||||||||||||
,
Aug 05, 2009
I've got this working for pgsql, just need to push up the code. I used the database_options dict as you suggested. |
|||||||||||||
,
Aug 05, 2009
Nice. I wonder how can we add testing for this. Or shouldn't it need any special tests? |
|||||||||||||
,
Oct 27, 2009
Hey Vic, can you commit the associated code (or post a patch here)? |
|||||||||||||
,
Dec 20 (5 days ago)
> Hey Vic, can you commit the associated code (or post a patch here)? any news on this? I'd like to patch it here to do that. |
|||||||||||||
,
Dec 21 (4 days ago)
i branched and updated the base.py in postgresql's backend. I did *not* put in the fallback code though. I can't seem to get the failover to 'regular' connections to work properly and when I finally did kludge a solution - it wasn't obvious to me whether I was hitting 'raw' database connections or through the JNDI/IIOP connection. Which is bad. And not very python-like. The patch can be applied to the other backends safely - it's pretty small. The tricky part is figuring out what bizarre set of JAR files are required to instantiate the InitialContextFactory for your particular JNDI server.
Status: Fixed
|
|||||||||||||
|
|
|||||||||||||