Robin created Bug GEOT-4187
Issue Type: Bug Bug
Affects Versions: 8.0-RC1
Assignee: Unassigned
Attachments: h2-null-db.png
Components: jdbc-h2 plugin
Created: 28/Jun/12 9:08 AM
Description:

According to the docs I used the code below to get an H2Datastore configured by JNDI:

Map<String, Object> params = new HashMap<String, Object>();
params.put(JDBCDataStoreFactory.DBTYPE.key, "h2");
params.put(JDBCJNDIDataStoreFactory.JNDI_REFNAME.key, DATASOURCE_JNDI_NAME);
JDBCDataStore datastore = (JDBCDataStore) DataStoreFinder.getDataStore(params);
// datastore is now an file-based db which matches not the configuration from JNDI

While retrieving the functional factories by dbtype H2DataStoreFactory and H2JNDIDataStoreFactory were returned. This is correct but in the next step the usability of each gets checked. At first H2DataStoreFactory is checked and also selected because it needs only the type (user and so on are optional). So it is used to generate the store without checking H2JNDIDataStoreFactory which fits definitely better because jndiReferenceName (JDBCJNDIDataStoreFactory.JNDI_REFNAME.key) is defined.
In last consequence an file database null.*.db is created in the execution folder. I recognized this behavior also in the gt-project download where I found null-database in the zip (see attachment).

Environment: Win 7 64bit, jdk 1.6.0_29
Project: GeoTools
Priority: Critical Critical
Reporter: Robin
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to