From b304a9b78a14d207b747840c268fb5b35d319f5f Mon Sep 17 00:00:00 2001 From: "fabio.sinibaldi" Date: Mon, 20 May 2019 16:58:42 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-publishing/gCat-Feeder-Suite@179492 82a268e6-3cf1-43bd-a215-b396298e98cf --- gCat-Controller/pom.xml | 26 +++++ .../catalogues/gCat/GCatController.java | 23 +++- .../catalogues/gCat/full-algorithm.json | 44 +++++--- .../gCatFeeder/catalogues/gCat/onlyItem.json | 101 ++++++++++++++++++ .../gCat-Controller/pom.properties | 2 +- .../gCat-Controller/pom.xml | 26 +++++ .../catalogues/gCat/GCatController.class | Bin 5330 -> 13894 bytes .../catalogues/gCat/full-algorithm.json | 44 +++++--- .../gCatFeeder/catalogues/gCat/onlyItem.json | 101 ++++++++++++++++++ .../org.eclipse.wst.common.component | 9 -- .../service/engine/LocalConfiguration.java | 4 +- .../persistence/ConnectionManagerImpl.java | 11 +- .../persistence/PersistenceManagerImpl.java | 2 +- .../resources/gcat-feeder-config.properties | 4 +- 14 files changed, 346 insertions(+), 51 deletions(-) diff --git a/gCat-Controller/pom.xml b/gCat-Controller/pom.xml index b2f1b24..5504273 100644 --- a/gCat-Controller/pom.xml +++ b/gCat-Controller/pom.xml @@ -9,6 +9,18 @@ gCat Controller Controller implementation for GCat Service + + + + org.gcube.distribution + gcube-bom + LATEST + pom + import + + + + @@ -32,6 +44,20 @@ test + + + com.fasterxml.jackson.core + jackson-databind + provided + + + + + org.slf4j + slf4j-api + provided + + diff --git a/gCat-Controller/src/main/java/org/gcube/data/publishing/gCataFeeder/catalogues/gCat/GCatController.java b/gCat-Controller/src/main/java/org/gcube/data/publishing/gCataFeeder/catalogues/gCat/GCatController.java index bfa7030..36d55ae 100644 --- a/gCat-Controller/src/main/java/org/gcube/data/publishing/gCataFeeder/catalogues/gCat/GCatController.java +++ b/gCat-Controller/src/main/java/org/gcube/data/publishing/gCataFeeder/catalogues/gCat/GCatController.java @@ -63,7 +63,7 @@ public class GCatController implements CatalogueController{ try { builder= factory.newDocumentBuilder(); - expr= xpath.compile("string(/bookstore/book/title/@lang)"); + expr= xpath.compile("string(//metadataformat/@type)"); } catch (ParserConfigurationException | XPathExpressionException e) { throw new RuntimeException("Unable to initialize Controller"); } @@ -141,7 +141,7 @@ public class GCatController implements CatalogueController{ } log.debug("Publishing Item.."); - String itemResp=createItem(itemNode.asText()); + String itemResp=createItem(itemNode.toString(),itemNode.path("name").textValue()); String itemId = getId(itemResp); log.debug("Pubilshed Item with ID {} ",itemId); @@ -263,13 +263,17 @@ public class GCatController implements CatalogueController{ } - private String createItem(String toCreate) throws WrongObjectFormatException, PublicationException{ + private String createItem(String toCreate,String name) throws WrongObjectFormatException, PublicationException{ Item item=null; try{ if(isForcedUrl()) item = new Item(getForcedUrl()); else item=new Item(); - return item.create(toCreate); + + if(existsItem(item,name)) + return item.update(name, toCreate); + else return item.create(toCreate); + }catch(WebApplicationException e) { handleWebException(e); return null; @@ -280,7 +284,15 @@ public class GCatController implements CatalogueController{ } - + private boolean existsItem(Item item,String name) { + try { + item.read(name); + return true; + }catch(WebApplicationException e) { + log.debug("Read Item returned error. Assuming it's missing ",e); + return false; + } + } @@ -339,6 +351,7 @@ public class GCatController implements CatalogueController{ } + private static String getId(String publishResponse) { try { return mapper.readTree(publishResponse).path("result").path("id").asText(); diff --git a/gCat-Controller/src/test/resources/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/full-algorithm.json b/gCat-Controller/src/test/resources/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/full-algorithm.json index 7a052b2..5e5f9d4 100644 --- a/gCat-Controller/src/test/resources/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/full-algorithm.json +++ b/gCat-Controller/src/test/resources/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/full-algorithm.json @@ -1,21 +1,39 @@ { - "profile": "\n \n Input Parameter\n String\n false\n Input parameter expected for the execution of the algorithm\n \n", + "profileID": "DataMiner Process", + "profile": "\n\t\n\t\tInput Parameter\n\t\tfalse\n\t\tString\n\t\tInput parameter expected for the execution of the process\n\t\n\t\n\t\tOutput Parameter\n\t\tfalse\n\t\tString\n\t\tOutput parameter expected from the execution of the process\n\t\t\n\t\n\t\n\t\tProcess Author\n\t\tfalse\n\t\tString\n\t\t*\n\t\t\n\t\tThe name of the author, with email and ORCID. The format should\n\t\t\tbe: family, given[, email][, ORCID]. Example: Smith, John,\n\t\t\tjs@acme.org, orcid.org/0000-0002-1825-0097\n\t\t\n\t\t\t^[a-zA-ZÀ-ÿ .'-]+, [a-zA-ZÀ-ÿ .'-]+[,\n\t\t\t\t]*([a-zA-Z0-9_!#$%’*+=?`{|}~^.-]+@[a-zA-Z0-9À-ÿ.-]+)?[,\n\t\t\t\t]*(orcid.org\\/0000-000(1-[5-9]|2-[0-9]|3-[0-4])\\d\\d\\d-\\d\\d\\d[\\dX])?$\n\t\t\n\t\n", "item": { - "name": "step_4_vpa_iccat_bft_e_report_in_nextnext", - "title": "Step 4 Vpa Iccat Bft E Report in NextNext", - "description": "ICCAT (Eastern) Bluefin Tuna Stock Assessment. This set of R and Fortran code have been provided by ICCAT and IFremer to execute the whole Stock assessment workflow online integration has been done with the help (mediation) of CNR and IRD", + "name": "grid_cwp_to_coordinates_in_prevre", + "title": "Grid Cwp To Coordinates in preVRE", + "description": "An algorithm that adds longitude, latitude and resolution columns analysing a column containing FAO Ocean Area codes (CWP format).", "version": null, - "visibility": null, - "license": "CC-BY-NC-SA-4.0", - "author": "gianpaolo.coro", - "maintainer": "gianpaolo.coro", - "tags": ["Iccat Eastern Bft Stock Assessment"], + "license_id": "CC-BY-NC-SA-4.0", + "author": null, + "maintainer": null, + "tags": [ + { + "name": "Geo Processing" + }, + { + "name": "preVRE" + }, + { + "name": "WPS" + }, + { + "name": "Analytics" + }], "extras": [ { - "key": "system", - "value": "Algorithm" - }] + "key": "system:type", + "value": "DataMiner Process" + }], + "private": true }, - "resources": [] + "resources": [ + { + "name": "Gateway Link", + "url": "https://pre.d4science.org/group/prevre/dataminer-manager?OperatorId=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.GRID_CWP_TO_COORDINATES", + "description": "Link to the GUI designed to operate with DataMiner" + }] } \ No newline at end of file diff --git a/gCat-Controller/src/test/resources/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/onlyItem.json b/gCat-Controller/src/test/resources/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/onlyItem.json index e69de29..7ed5ddb 100644 --- a/gCat-Controller/src/test/resources/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/onlyItem.json +++ b/gCat-Controller/src/test/resources/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/onlyItem.json @@ -0,0 +1,101 @@ +{ + "profile": null, + "item": { + "license_title": "Creative Commons Attribution Share-Alike 4.0", + "maintainer": null, + "searchable": "true", + "relationships_as_object": [], + "private": true, + "maintainer_email": null, + "num_tags": 2, + "metadata_created": "2019-03-19T15:03:28.482434", + "metadata_modified": "2019-03-19T15:03:30.676258", + "author": "luca_frosini", + "author_email": "luca.frosini@gcube.ckan.org", + "state": "active", + "version": null, + "creator_user_id": "287b2eec-4cd7-4e50-817f-e6dce19995c7", + "type": "dataset", + "tags": [ + { + "vocabulary_id": null, + "state": "active", + "display_name": "Other", + "id": "8ca635e2-4f72-48ed-8460-6734e9070a00", + "name": "Other" + }, + { + "vocabulary_id": null, + "state": "active", + "display_name": "REST", + "id": "3d481290-b3cd-466f-8142-51608c616e60", + "name": "REST" + } + ], + "groups": [], + "license_id": "CC-BY-SA-4.0", + "extras": [ + { + "key": "FSKX_model_parameters:Input Parameter", + "value": "standard desviation of Temperatures( sdTemp): 2.9 °c( Double)" + }, + { + "key": "FSKX_model_parameters:Output Parameter", + "value": "" + }, + { + "key": "FSKX_model_scope:Hazard", + "value": "" + }, + { + "key": "FSKX_model_scope:Population", + "value": "" + }, + { + "key": "FSKX_model_scope:Product", + "value": "" + }, + { + "key": "Item URL", + "value": "http://data.d4science.org/ctlg/AGINFRAplusDev/my_first_restful_transaction_model" + }, + { + "key": "Model Author", + "value": "" + }, + { + "key": "Model Creator", + "value": "" + }, + { + "key": "Model ID", + "value": "" + }, + { + "key": "Model Language", + "value": "Other" + }, + { + "key": "Population", + "value": "Italian" + }, + { + "key": "ReadMe", + "value": "" + }, + { + "key": "Reference Description", + "value": "" + }, + { + "key": "Related Identifier", + "value": "" + }, + { + "key": "system:type", + "value": "My Profile" + } + ] + }, + "resources": null +} \ No newline at end of file diff --git a/gCat-Controller/target/classes/META-INF/maven/org.gcube.data-publishing.gCat-Feeder/gCat-Controller/pom.properties b/gCat-Controller/target/classes/META-INF/maven/org.gcube.data-publishing.gCat-Feeder/gCat-Controller/pom.properties index f53060c..28dc669 100644 --- a/gCat-Controller/target/classes/META-INF/maven/org.gcube.data-publishing.gCat-Feeder/gCat-Controller/pom.properties +++ b/gCat-Controller/target/classes/META-INF/maven/org.gcube.data-publishing.gCat-Feeder/gCat-Controller/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Wed May 08 18:18:34 CEST 2019 +#Mon May 20 17:18:44 CEST 2019 version=1.0.0-SNAPSHOT groupId=org.gcube.data-publishing.gCat-Feeder m2e.projectName=gCat-Controller diff --git a/gCat-Controller/target/classes/META-INF/maven/org.gcube.data-publishing.gCat-Feeder/gCat-Controller/pom.xml b/gCat-Controller/target/classes/META-INF/maven/org.gcube.data-publishing.gCat-Feeder/gCat-Controller/pom.xml index b2f1b24..5504273 100644 --- a/gCat-Controller/target/classes/META-INF/maven/org.gcube.data-publishing.gCat-Feeder/gCat-Controller/pom.xml +++ b/gCat-Controller/target/classes/META-INF/maven/org.gcube.data-publishing.gCat-Feeder/gCat-Controller/pom.xml @@ -9,6 +9,18 @@ gCat Controller Controller implementation for GCat Service + + + + org.gcube.distribution + gcube-bom + LATEST + pom + import + + + + @@ -32,6 +44,20 @@ test + + + com.fasterxml.jackson.core + jackson-databind + provided + + + + + org.slf4j + slf4j-api + provided + + diff --git a/gCat-Controller/target/classes/org/gcube/data/publishing/gCataFeeder/catalogues/gCat/GCatController.class b/gCat-Controller/target/classes/org/gcube/data/publishing/gCataFeeder/catalogues/gCat/GCatController.class index 4ac5c2630a644852fcd09d0ab0fad9489995962d..03e516e83b590698468d36874905e36eb2ea76af 100644 GIT binary patch literal 13894 zcmb_i34Byn)j#LWByTc#1e%m(SO*9+D+8r0O(-QHEFmF42&92lJDI#B1CyC_X2Mci ztJH4P+E&F1)~dCF)~acc2{a0Bty)_@wJxn|-Re@8YO8g@;{V+DX66M#fv@r-bLZWA z-??Y`pXJ^=PrmlpaU!}*o1v4&R2PeP1-e3g?Pj1Om<$Gb``RPnM0Yrf-sR|6X__5o zJP^XyNUW>ROsMX_DvT|UMU(MZBx1&Oax;zD7TggGM1pv8UHdjOl+-DgY5D8ZKa;#H zs#eO9XL6y3sjyLqB_f@dZ3{HUy1LAGHB)X+u(#KYGgUT*Vm*P*U?OS8clAU9+k&C( ziC9#L)gF#^*j%ku)A6F-84M+3@!d>ijl%k_fV|Zkj3>-^B2X6#_4Sz1WNlwK0tKwJ z=E`gBRu9w6bH9f9#;*0jWOrt*sg9R+^7L}?3!z~&i`QpBzCIQShX4U>Ydw=^NhlJIhLcMHxRTP%P~UQB z#7om@rcN_plGEX5Tg{+in#GjYWhO0HGR-P+Xl8jNm`GHYo{8Q(V!Fg2ojf{~GL>Hd zfW1^gNJn3>REk z%P%x2pA0W8rYfB-XPTT{{!FmTl7NeU*dk|6s}{mn7&My32;nOYT1GW67C2R|!{j>~ z1@-E3gD#>%QOOE}R?;e<7O$S>-(s=zkW~?^H)s?Uc&LGCYC?g&BoOE^lR?2_XDr?m zOa_)EclVm5`LveS>D0tDc0@%Ow4OE~q`>aI;fTq!zzG}Mp`2_vwBzt|QP4(%is)jU zHZe`i`ebuoG#TzOSL_Ozz2Z$CYGs*oIy_4TwP*a*8S{3G~m4#vas zYV&C9S>0r2GBuQ3P^3y{sI;Rv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nZpst%3d#XGNw1pn6uoB3)4(D+2HZ3B2KwJb zZ3wlql*QLoSR6o^`Gv-w96$FHz4IGt12m5RVT>X=PZRhbHQyPUq)VtVdY9hAe-__6 z5vD8%6)VE~^g+X$4E(taoR8?51@XEC@jDCR0NtQZ8;HXwF9UDezd`t!tkCA)k5;ss z^w}7T^A|qTQj~E@-XjTYO^~E7}arwnbm>(ypsxV^)Mb-R&9Sq7~sD%{5k} z*>t}d>+arMvSJnb@W!zs%+o^8>$ze@c-RNRH7mj*5NzkGdqi$nurl\n \n Input Parameter\n String\n false\n Input parameter expected for the execution of the algorithm\n \n", + "profileID": "DataMiner Process", + "profile": "\n\t\n\t\tInput Parameter\n\t\tfalse\n\t\tString\n\t\tInput parameter expected for the execution of the process\n\t\n\t\n\t\tOutput Parameter\n\t\tfalse\n\t\tString\n\t\tOutput parameter expected from the execution of the process\n\t\t\n\t\n\t\n\t\tProcess Author\n\t\tfalse\n\t\tString\n\t\t*\n\t\t\n\t\tThe name of the author, with email and ORCID. The format should\n\t\t\tbe: family, given[, email][, ORCID]. Example: Smith, John,\n\t\t\tjs@acme.org, orcid.org/0000-0002-1825-0097\n\t\t\n\t\t\t^[a-zA-ZÀ-ÿ .'-]+, [a-zA-ZÀ-ÿ .'-]+[,\n\t\t\t\t]*([a-zA-Z0-9_!#$%’*+=?`{|}~^.-]+@[a-zA-Z0-9À-ÿ.-]+)?[,\n\t\t\t\t]*(orcid.org\\/0000-000(1-[5-9]|2-[0-9]|3-[0-4])\\d\\d\\d-\\d\\d\\d[\\dX])?$\n\t\t\n\t\n", "item": { - "name": "step_4_vpa_iccat_bft_e_report_in_nextnext", - "title": "Step 4 Vpa Iccat Bft E Report in NextNext", - "description": "ICCAT (Eastern) Bluefin Tuna Stock Assessment. This set of R and Fortran code have been provided by ICCAT and IFremer to execute the whole Stock assessment workflow online integration has been done with the help (mediation) of CNR and IRD", + "name": "grid_cwp_to_coordinates_in_prevre", + "title": "Grid Cwp To Coordinates in preVRE", + "description": "An algorithm that adds longitude, latitude and resolution columns analysing a column containing FAO Ocean Area codes (CWP format).", "version": null, - "visibility": null, - "license": "CC-BY-NC-SA-4.0", - "author": "gianpaolo.coro", - "maintainer": "gianpaolo.coro", - "tags": ["Iccat Eastern Bft Stock Assessment"], + "license_id": "CC-BY-NC-SA-4.0", + "author": null, + "maintainer": null, + "tags": [ + { + "name": "Geo Processing" + }, + { + "name": "preVRE" + }, + { + "name": "WPS" + }, + { + "name": "Analytics" + }], "extras": [ { - "key": "system", - "value": "Algorithm" - }] + "key": "system:type", + "value": "DataMiner Process" + }], + "private": true }, - "resources": [] + "resources": [ + { + "name": "Gateway Link", + "url": "https://pre.d4science.org/group/prevre/dataminer-manager?OperatorId=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.GRID_CWP_TO_COORDINATES", + "description": "Link to the GUI designed to operate with DataMiner" + }] } \ No newline at end of file diff --git a/gCat-Controller/target/test-classes/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/onlyItem.json b/gCat-Controller/target/test-classes/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/onlyItem.json index e69de29..7ed5ddb 100644 --- a/gCat-Controller/target/test-classes/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/onlyItem.json +++ b/gCat-Controller/target/test-classes/org/gcube/data/publishing/gCatFeeder/catalogues/gCat/onlyItem.json @@ -0,0 +1,101 @@ +{ + "profile": null, + "item": { + "license_title": "Creative Commons Attribution Share-Alike 4.0", + "maintainer": null, + "searchable": "true", + "relationships_as_object": [], + "private": true, + "maintainer_email": null, + "num_tags": 2, + "metadata_created": "2019-03-19T15:03:28.482434", + "metadata_modified": "2019-03-19T15:03:30.676258", + "author": "luca_frosini", + "author_email": "luca.frosini@gcube.ckan.org", + "state": "active", + "version": null, + "creator_user_id": "287b2eec-4cd7-4e50-817f-e6dce19995c7", + "type": "dataset", + "tags": [ + { + "vocabulary_id": null, + "state": "active", + "display_name": "Other", + "id": "8ca635e2-4f72-48ed-8460-6734e9070a00", + "name": "Other" + }, + { + "vocabulary_id": null, + "state": "active", + "display_name": "REST", + "id": "3d481290-b3cd-466f-8142-51608c616e60", + "name": "REST" + } + ], + "groups": [], + "license_id": "CC-BY-SA-4.0", + "extras": [ + { + "key": "FSKX_model_parameters:Input Parameter", + "value": "standard desviation of Temperatures( sdTemp): 2.9 °c( Double)" + }, + { + "key": "FSKX_model_parameters:Output Parameter", + "value": "" + }, + { + "key": "FSKX_model_scope:Hazard", + "value": "" + }, + { + "key": "FSKX_model_scope:Population", + "value": "" + }, + { + "key": "FSKX_model_scope:Product", + "value": "" + }, + { + "key": "Item URL", + "value": "http://data.d4science.org/ctlg/AGINFRAplusDev/my_first_restful_transaction_model" + }, + { + "key": "Model Author", + "value": "" + }, + { + "key": "Model Creator", + "value": "" + }, + { + "key": "Model ID", + "value": "" + }, + { + "key": "Model Language", + "value": "Other" + }, + { + "key": "Population", + "value": "Italian" + }, + { + "key": "ReadMe", + "value": "" + }, + { + "key": "Reference Description", + "value": "" + }, + { + "key": "Related Identifier", + "value": "" + }, + { + "key": "system:type", + "value": "My Profile" + } + ] + }, + "resources": null +} \ No newline at end of file diff --git a/gCat-Feeder/.settings/org.eclipse.wst.common.component b/gCat-Feeder/.settings/org.eclipse.wst.common.component index b3da5df..6d37f66 100644 --- a/gCat-Feeder/.settings/org.eclipse.wst.common.component +++ b/gCat-Feeder/.settings/org.eclipse.wst.common.component @@ -4,15 +4,6 @@ - - uses - - - uses - - - uses - diff --git a/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/LocalConfiguration.java b/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/LocalConfiguration.java index 50bdf38..9afed7e 100644 --- a/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/LocalConfiguration.java +++ b/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/LocalConfiguration.java @@ -7,8 +7,8 @@ public interface LocalConfiguration { public static final String POOL_MIN_IDLE="db.pools.min_total"; - public static final String MAPPING_DB_ENDPOINT_NAME="db.ep.name"; - public static final String MAPPING_DB_ENDPOINT_CATEGORY="db.ep.category"; + public static final String DB_ENDPOINT_NAME="db.ep.name"; + public static final String DB_ENDPOINT_CATEGORY="db.ep.category"; diff --git a/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/impl/persistence/ConnectionManagerImpl.java b/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/impl/persistence/ConnectionManagerImpl.java index 667131e..f21814d 100644 --- a/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/impl/persistence/ConnectionManagerImpl.java +++ b/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/impl/persistence/ConnectionManagerImpl.java @@ -59,16 +59,17 @@ public class ConnectionManagerImpl implements ConnectionManager { @Inject private LocalConfiguration configuration; - private synchronized DatabaseConnectionDescriptor getDB() throws InternalError { + private synchronized DatabaseConnectionDescriptor getDB() throws InternalError { if(!databases.containsKey(infrastructure.getCurrentContext())) databases.put(infrastructure.getCurrentContext(), infrastructure.queryForDatabase( - configuration.getProperty(LocalConfiguration.MAPPING_DB_ENDPOINT_CATEGORY), - configuration.getProperty(LocalConfiguration.MAPPING_DB_ENDPOINT_NAME))); + configuration.getProperty(LocalConfiguration.DB_ENDPOINT_CATEGORY), + configuration.getProperty(LocalConfiguration.DB_ENDPOINT_NAME))); return databases.get(infrastructure.getCurrentContext()); } @Override public Connection getConnection() throws SQLException, InternalError { + log.debug("Getting DB connection in {} ",infrastructure.getCurrentContext()); DataSource ds=getDataSource(); Connection conn=ds.getConnection(); conn.setAutoCommit(false); @@ -119,8 +120,8 @@ public class ConnectionManagerImpl implements ConnectionManager { Connection conn=null; try{ conn=dataSource.getConnection(); - conn.createStatement().executeUpdate(Queries.getInitDB(db.getFlavor())); - conn.commit(); + conn.setAutoCommit(true); + conn.createStatement().executeUpdate(Queries.getInitDB(db.getFlavor())); }catch(SQLException e) { throw new InternalError("Unable to Init database "+db,e); }finally { diff --git a/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/impl/persistence/PersistenceManagerImpl.java b/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/impl/persistence/PersistenceManagerImpl.java index 18de7ad..3aa586b 100644 --- a/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/impl/persistence/PersistenceManagerImpl.java +++ b/gCat-Feeder/src/main/java/org/gcube/data/publishing/gCatFeeder/service/engine/impl/persistence/PersistenceManagerImpl.java @@ -106,7 +106,7 @@ public class PersistenceManagerImpl implements PersistenceManager { throws PersistenceError, InvalidRequest { Connection conn=null; try { - log.debug("Looking for execution according to filter {} ",filter); + log.debug("Looking for execution according to filter {}",filter); conn=connections.getConnection(); ArrayList toReturn=new ArrayList<>(); PreparedStatement psGet=Queries.GET_ALL.get(conn, filter); diff --git a/gCat-Feeder/src/main/resources/gcat-feeder-config.properties b/gCat-Feeder/src/main/resources/gcat-feeder-config.properties index b92b613..87c721f 100644 --- a/gCat-Feeder/src/main/resources/gcat-feeder-config.properties +++ b/gCat-Feeder/src/main/resources/gcat-feeder-config.properties @@ -2,5 +2,5 @@ db.pools.max_idle=5 db.pools.max_total=50 db.pools.min_total=3 -mapping-db.ep.name=Feeder_DB -mapping-db.ep.category=Database \ No newline at end of file +db.ep.name=Feeder_DB +db.ep.category=Database \ No newline at end of file