Bug 401 : ENH: Add ability to specify custom parameters when using Ebean's internal DataSource.
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.7.7
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
27/05/2012
Updated 
27/05/2012
Type 
Bug
 
Attachments 
No attachments

ie. Ability to specify something like ... ebean.ora.connectionProperties=oracle.net.CONNECT_TIMEOUT=3000;oracle.jdbc.ReadTimeout=10000 in the properties file or programmatically via ServerConfig.


Right now you can't. If you look at DataSourceConfig it doesn't provide a place to put arbitrary connection properties. It is definitely something that you SHOULD be able to do though so I'll log it as an enhancement request and hopefully action it.

A workaround right now would be to use another external DataSource (but Ebean's own DataSource implementation is pretty darn good so we want to log this enhancement and sort it).

 
Rob 27 May 11:03
The fix

DataSourceConfig has additional customProperties property. This is of type Map.

Rob 27 May 11:04
or load from ebean.properties

In addition you can set the fields via ebean.properties. Say you where configuring a datasource called 'ora':

datasource.ora.username=junk
datasource.ora.password=junk
...
datasource.ora.customProperties=oracle.net.CONNECT_TIMEOUT=3000;oracle.jdbc.ReadTimeout=10000

Rob 27 May 11:05
Fixed in HEAD

fixed in HEAD.

woResponse

Upload a file