More on the primary key issue…When I run the junit class, OracleDataStoreAPIOnlineTest…
This gets into the method - testGetFeaturesWriterAdd, which leads to this code: LOGGER.log(Level.FINE, "Grabbing table pk metadata: {0}", sql); ResultSet rs = st.executeQuery(sql.toString()); The first two times the code gets here the SQL is: SELECT FID FROM ROAD WHERE 0=1 That is valid SQL based on the structure of the table and it executes successfully. Then the code gets here and the SQL is: SELECT ROAD_ID FROM ROAD WHERE 0=1 That is invalid SQL and fails. But that does not make the test case itself fail since the error gets trapped and logged as a warning. } catch(SQLException e) { LOGGER.log(Level.WARNING, "Failure occurred while looking up the primary " + "key with finder: " + finder, e); So I can’t say that these messages I get about primary keys are unexpected or directly causing problems without more hunting around. From: Walter Stovall Sent: Friday, October 09, 2015 4:57 AM To: Andrea Aime Cc: geotools-devel@lists.sourceforge.net Subject: Re: [Geotools-devel] Oracle tests fail in geotools master You say your user has “full rights”. I’m granting (see script below) privilege to do just about anything I’ve discovered over the years that I might want to. FWIW I successfully use geoserver (and a geotools-based client app) to read and write to layers and have ‘expose primary keys’ turned on there. That all seems to work without a hitch. In fact, I’ve also had problems publishing Views with ‘expose primary keys’ turned on till I did an ALTER VIEW statement to give the view a primary key – then it works fine. I don’t have apparent functional problems with geoserver or geotools except when running the oracle junit tests. That said, my error-free environment is currently based on recently downloaded releases, not code I’m building, so I’m not really talking apples & apples here. BUT the error-free environment is based on exactly the same Oracle server and user privileges – so THAT IS apples & apples. If you execute this query you can see (mostly) what privileges you have: SELECT PRIVILEGE FROM sys.dba_sys_privs WHERE grantee = <USERNAME> UNION SELECT PRIVILEGE FROM dba_role_privs rp JOIN role_sys_privs rsp ON (rp.granted_role = rsp.role) WHERE rp.grantee = <USERNAME> ORDER BY 1; The output I get for that is: ADMINISTER ANY SQL TUNING SET ADMINISTER DATABASE TRIGGER ADMINISTER RESOURCE MANAGER ADMINISTER SQL MANAGEMENT OBJECT ADMINISTER SQL TUNING SET ADVISOR ALTER ANY ASSEMBLY ALTER ANY CLUSTER ALTER ANY CUBE ALTER ANY CUBE DIMENSION ALTER ANY DIMENSION ALTER ANY EDITION ALTER ANY EVALUATION CONTEXT ALTER ANY INDEX ALTER ANY INDEXTYPE ALTER ANY LIBRARY ALTER ANY MATERIALIZED VIEW ALTER ANY MINING MODEL ALTER ANY OPERATOR ALTER ANY OUTLINE ALTER ANY PROCEDURE ALTER ANY ROLE ALTER ANY RULE ALTER ANY RULE SET ALTER ANY SEQUENCE ALTER ANY SQL PROFILE ALTER ANY TABLE ALTER ANY TRIGGER ALTER ANY TYPE ALTER DATABASE ALTER PROFILE ALTER RESOURCE COST ALTER ROLLBACK SEGMENT ALTER SESSION ALTER SYSTEM ALTER TABLESPACE ALTER USER ANALYZE ANY ANALYZE ANY DICTIONARY AUDIT ANY AUDIT SYSTEM BACKUP ANY TABLE BECOME USER CHANGE NOTIFICATION COMMENT ANY MINING MODEL COMMENT ANY TABLE CREATE ANY ASSEMBLY CREATE ANY CLUSTER CREATE ANY CONTEXT CREATE ANY CUBE CREATE ANY CUBE BUILD PROCESS CREATE ANY CUBE DIMENSION CREATE ANY DIMENSION CREATE ANY DIRECTORY CREATE ANY EDITION CREATE ANY EVALUATION CONTEXT CREATE ANY INDEX CREATE ANY INDEXTYPE CREATE ANY JOB CREATE ANY LIBRARY CREATE ANY MATERIALIZED VIEW CREATE ANY MEASURE FOLDER CREATE ANY MINING MODEL CREATE ANY OPERATOR CREATE ANY OUTLINE CREATE ANY PROCEDURE CREATE ANY RULE CREATE ANY RULE SET CREATE ANY SEQUENCE CREATE ANY SQL PROFILE CREATE ANY SYNONYM CREATE ANY TABLE CREATE ANY TRIGGER CREATE ANY TYPE CREATE ANY VIEW CREATE ASSEMBLY CREATE CLUSTER CREATE CUBE CREATE CUBE BUILD PROCESS CREATE CUBE DIMENSION CREATE DATABASE LINK CREATE DIMENSION CREATE EVALUATION CONTEXT CREATE EXTERNAL JOB CREATE INDEXTYPE CREATE JOB CREATE LIBRARY CREATE MATERIALIZED VIEW CREATE MEASURE FOLDER CREATE MINING MODEL CREATE OPERATOR CREATE PROCEDURE CREATE PROFILE CREATE PUBLIC DATABASE LINK CREATE PUBLIC SYNONYM CREATE ROLE CREATE ROLLBACK SEGMENT CREATE RULE CREATE RULE SET CREATE SEQUENCE CREATE SESSION CREATE SYNONYM CREATE TABLE CREATE TABLESPACE CREATE TRIGGER CREATE TYPE CREATE USER CREATE VIEW DEBUG ANY PROCEDURE DEBUG CONNECT SESSION DELETE ANY CUBE DIMENSION DELETE ANY MEASURE FOLDER DELETE ANY TABLE DEQUEUE ANY QUEUE DROP ANY ASSEMBLY DROP ANY CLUSTER DROP ANY CONTEXT DROP ANY CUBE DROP ANY CUBE BUILD PROCESS DROP ANY CUBE DIMENSION DROP ANY DIMENSION DROP ANY DIRECTORY DROP ANY EDITION DROP ANY EVALUATION CONTEXT DROP ANY INDEX DROP ANY INDEXTYPE DROP ANY LIBRARY DROP ANY MATERIALIZED VIEW DROP ANY MEASURE FOLDER DROP ANY MINING MODEL DROP ANY OPERATOR DROP ANY OUTLINE DROP ANY PROCEDURE DROP ANY ROLE DROP ANY RULE DROP ANY RULE SET DROP ANY SEQUENCE DROP ANY SQL PROFILE DROP ANY SYNONYM DROP ANY TABLE DROP ANY TRIGGER DROP ANY TYPE DROP ANY VIEW DROP PROFILE DROP PUBLIC DATABASE LINK DROP PUBLIC SYNONYM DROP ROLLBACK SEGMENT DROP TABLESPACE DROP USER ENQUEUE ANY QUEUE EXECUTE ANY ASSEMBLY EXECUTE ANY CLASS EXECUTE ANY EVALUATION CONTEXT EXECUTE ANY INDEXTYPE EXECUTE ANY LIBRARY EXECUTE ANY OPERATOR EXECUTE ANY PROCEDURE EXECUTE ANY PROGRAM EXECUTE ANY RULE EXECUTE ANY RULE SET EXECUTE ANY TYPE EXECUTE ASSEMBLY EXPORT FULL DATABASE FLASHBACK ANY TABLE FLASHBACK ARCHIVE ADMINISTER FORCE ANY TRANSACTION FORCE TRANSACTION GLOBAL QUERY REWRITE GRANT ANY OBJECT PRIVILEGE GRANT ANY PRIVILEGE GRANT ANY ROLE IMPORT FULL DATABASE INSERT ANY CUBE DIMENSION INSERT ANY MEASURE FOLDER INSERT ANY TABLE LOCK ANY TABLE MANAGE ANY FILE GROUP MANAGE ANY QUEUE MANAGE FILE GROUP MANAGE SCHEDULER MANAGE TABLESPACE MERGE ANY VIEW ON COMMIT REFRESH QUERY REWRITE READ ANY FILE GROUP RESTRICTED SESSION RESUMABLE SELECT ANY CUBE SELECT ANY CUBE DIMENSION SELECT ANY DICTIONARY SELECT ANY MINING MODEL SELECT ANY SEQUENCE SELECT ANY TABLE SELECT ANY TRANSACTION UNDER ANY TABLE UNDER ANY TYPE UNDER ANY VIEW UNLIMITED TABLESPACE UPDATE ANY CUBE UPDATE ANY CUBE BUILD PROCESS UPDATE ANY CUBE DIMENSION UPDATE ANY TABLE From: andrea.a...@gmail.com<mailto:andrea.a...@gmail.com> [mailto:andrea.a...@gmail.com] On Behalf Of Andrea Aime Sent: Friday, October 09, 2015 4:36 AM To: Walter Stovall Cc: Ben Caradoc-Davies; geotools-devel@lists.sourceforge.net<mailto:geotools-devel@lists.sourceforge.net> Subject: Re: [Geotools-devel] Oracle tests fail in geotools master Hi Walter, a short in the dark here, but if a test fails because it cannot locate a primary key, it could be you are not giving the user that's running the tests enough rights to figure out if something is a primary key, or not, and in that case, it decides it cannot do writing (we cannot do reliable OGC style writes without a PK, a feature id must always be present, unique and stable). In my local testing the user has pretty much full rights, so I'm not sure what grants would need to be added (assuming this is actually the cause of course) Cheers Andrea On Fri, Oct 9, 2015 at 10:29 AM, Walter Stovall <walter.stov...@byers.com<mailto:walter.stov...@byers.com>> wrote: Thanks for your help Ben. Oracle Version Info: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production TNS for Linux: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production The surefire reports show 3 failures and 47 errors. Maybe something is wrong with my setup. But a lot works in spite of these failures. Focusing on just the first error for now... Test class: Test being executed: OracleDataStoreAPIOnlineTest Test in error: testGetFeaturesWriterAdd Exception message: ROAD is read only Thrown by: ContentDataStore protected final ContentFeatureStore ensureFeatureStore(String typeName, Transaction tx) throws IOException { ContentFeatureSource featureSource = getFeatureSource(typeName,tx); if ( !( featureSource instanceof ContentFeatureStore)) { throw new IOException(typeName + " is read only" ); } return (ContentFeatureStore) featureSource; } This is the script that created my test schema in Oracle: DEF SA_SCHEMA_NAME=FDOTGEOTOOLS DEF SA_SCHEMA_PASSWORD=FDOTGEOTOOLS DEF SA_SCHEMA_DATAFILE=/u03/oradata/NWDEV/FDOTGEOTOOLS.dbf DEF SA_SCHEMA_DATAFILE_SIZE=64M DEF SA_SCHEMA_AUTOEXTEND_SIZE=64M DEF SA_SCHEMA_MAXSIZE=UNLIMITED CREATE TABLESPACE "&&SA_SCHEMA_NAME" DATAFILE '&SA_SCHEMA_DATAFILE' SIZE &SA_SCHEMA_DATAFILE_SIZE AUTOEXTEND ON NEXT &SA_SCHEMA_AUTOEXTEND_SIZE MAXSIZE &SA_SCHEMA_MAXSIZE EXTENT MANAGEMENT LOCAL AUTOALLOCATE; CREATE USER "&&SA_SCHEMA_NAME" PROFILE "DEFAULT" IDENTIFIED BY "&&SA_SCHEMA_PASSWORD" DEFAULT TABLESPACE "&&SA_SCHEMA_NAME" ACCOUNT UNLOCK; COMMIT; GRANT "CONNECT" TO "&&SA_SCHEMA_NAME"; GRANT ALTER SESSION TO "&&SA_SCHEMA_NAME"; GRANT ALTER TABLESPACE TO "&&SA_SCHEMA_NAME"; GRANT CREATE PROCEDURE TO "&&SA_SCHEMA_NAME"; GRANT CREATE SEQUENCE TO "&&SA_SCHEMA_NAME"; GRANT CREATE SESSION TO "&&SA_SCHEMA_NAME"; GRANT CREATE SYNONYM TO "&&SA_SCHEMA_NAME"; GRANT CREATE TABLE TO "&&SA_SCHEMA_NAME"; GRANT CREATE TRIGGER TO "&&SA_SCHEMA_NAME"; GRANT CREATE TYPE TO "&&SA_SCHEMA_NAME"; GRANT CREATE VIEW TO "&&SA_SCHEMA_NAME"; GRANT EXECUTE ANY PROCEDURE TO "&&SA_SCHEMA_NAME"; GRANT EXECUTE ANY TYPE TO "&&SA_SCHEMA_NAME"; GRANT DBA TO "&&SA_SCHEMA_NAME"; GRANT SELECT ANY DICTIONARY TO "&&SA_SCHEMA_NAME"; GRANT CREATE DATABASE LINK TO "&&SA_SCHEMA_NAME"; COMMIT; ALTER USER "&&SA_SCHEMA_NAME" QUOTA UNLIMITED ON "&&SA_SCHEMA_NAME"; COMMIT; Before this error the console shows: INFO No primary key or unique index found for ROAD. In case it's meaningful in terms of what works vs. not here is a list of the tables in my schema after running the tests. Note that I've selectively run some individual tests since I did the full run. exec dbms_stats.gather_schema_stats('FDOTGEOTOOLS'); select table_name,num_rows from user_tables order by table_name; TABLE_NAME NUM_ROWS COLA_MARKETS_CS 1 CURVES 10 DATES 3 EMPTY 0 FT1 3 FTJOIN 4 FTJOIN2 4 FTNTABLE 0 GTMETA 1 GT_PK_METADATA 4 LAKE 1 LAKES 1 LINE3D 2 MDRT_5DCA1$ MDRT_5DCAF$ MDRT_5DE2E$ MDRT_5E69B$ MDRT_5EDE5$ MDRT_5EDF1$ MDRT_5EDFE$ MDRT_5EFDC$ MDRT_5F037$ MDRT_5F1BD$ MDRT_5F484$ MDRT_5F820$ MDRT_5FBAA$ MDRT_5FBB8$ MDRT_5FBC6$ MULTI 3 NEIGHBORS 25 NOKEY 3 NONFIRST 3 NONINC 3 PERSON 2 PLAINTABLE 3 POINT3D 2 RIVER 2 ROAD 3 SEQ 3 SEQTABLE 3 SKIPCOLUMN 1 TESTLOB 1 TESTLOBCREATE 0 TMULTIPOINT 0 UNIQ 3 ZIPCODE 0 -----Original Message----- From: Ben Caradoc-Davies [mailto:b...@transient.nz<mailto:b...@transient.nz>] Sent: Thursday, October 08, 2015 6:05 PM To: Walter Stovall; geotools-devel@lists.sourceforge.net<mailto:geotools-devel@lists.sourceforge.net> Subject: Re: [Geotools-devel] I would like to make a bug fix and need help on the process On 09/10/15 02:55, Walter Stovall wrote: > What's the difference between a "failure" and an "error"? A failure is when a JUnit assertion fails (an AssertionFailedError is thrown and caught in the enclosing JUnit TestRunner) and errors are when other exceptions are thrown. In practice they are all just failures from our point of view and the distinction can be ignored. > OracleDataStoreAPIOnlineTest [...] > OracleSpatialFiltersOnlineTest [...] > Being as new to the tool as I am and with limited time to invest, I'm not > very prepared to dive into debugging those tests. Are they perhaps somehow > obsolete or would you more suspect something about my environment? Tests are run by maven-surefire-plugin and full stack traces for these failures can be found in its reports. For these tests: jdbc-oracle/target/surefire-reports/org.geotools.data.oracle.OracleDataStoreAPIOnlineTest.txt jdbc-oracle/target/surefire-reports/org.geotools.data.oracle.OracleSpatialFiltersOnlineTest.txt The full stack trace can be very revealing. What is your Oracle version? Vanilla or Enterprise? Locator or Spatial? Are you using XE? How much memory and disk? Do you see any errors in the Oracle logs? Kind regards, -- Ben Caradoc-Davies <b...@transient.nz<mailto:b...@transient.nz>> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ _______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net<mailto:GeoTools-Devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/geotools-devel -- == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it AVVERTENZE AI SENSI DEL D.Lgs. 196/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003. The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc. -------------------------------------------------------
------------------------------------------------------------------------------
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel