| Summary: | Derby ClientDataSourceFactory creates an "embedded" connection even when configured for client access | ||
|---|---|---|---|
| Product: | [RT] Gemini.DBaccess | Reporter: | Tom Ware <tom.ware> |
| Component: | Core | Assignee: | Project Inbox <gemini.dbaccess-inbox> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Appears to be fixed already. |
public DataSource createDataSource(Properties props) throws SQLException { if (props == null) props = new Properties(); if (props.get(DataSourceFactory.JDBC_URL) != null) { return new UrlBasedDriverDataSource(props); } else { DataSource dataSource = (jdbc4) ? new ClientDataSource40() : new ClientDataSource(); setDataSourceProperties(dataSource, props); return dataSource; } } Notice if (props.get(DataSourceFactory.JDBC_URL) != null) { return new UrlBasedDriverDataSource(props); The constructor here is like this: public UrlBasedDriverDataSource(Properties properties) { this(properties, true); } the second argument, "true" indicates is for the "embedded" property, so it makes datasource think it is for an embedded driver rather than a client driver This causes a test failure. Fix: if (props.get(DataSourceFactory.JDBC_URL) != null) { return new UrlBasedDriverDataSource(props, false); With this fix, the test passes