{"action":"created","comment":{"url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments/31118299","id":31118299,"diff_hunk":"@@ -185,21 +204,45 @@ public void registerWritePolicySelector(final WritePolicySelector writePolicySel\n   @Override\n   @Guarded(by = STARTED)\n   public StorageTx openTx() {\n-    return openStorageTx(null);\n+    return openStorageTx(databaseInstanceProvider.get().acquire(), false);\n   }\n \n   @Override\n   @Guarded(by = STARTED)\n   public StorageTx openTx(final ODatabaseDocumentTx db) {\n     checkNotNull(db);\n-    return openStorageTx(db);\n+    return openStorageTx(db, true);\n   }\n \n-  private StorageTx openStorageTx(final ODatabaseDocumentTx db) {\n-    ODatabaseDocumentTx database = db;\n-    if (database == null) {\n-      database = databaseInstanceProvider.get().acquire();\n+  /**\n+   * Find content validator for repository format.\n+   *\n+   * If no format-specific validator is configured, the default is used.\n+   */\n+  @Nonnull\n+  private ContentValidator validator() {","path":"components/nexus-repository/src/main/java/org/sonatype/nexus/repository/storage/StorageFacetImpl.java","position":104,"original_position":104,"commit_id":"1ba25e91a8365ce9f1db35b3250c13f0b3ef3ba9","original_commit_id":"31c91fd4d196ecddc7abb332a5a834db10819bb1","user":{"login":"mrprescott","id":2325642,"avatar_url":"https://avatars.githubusercontent.com/u/2325642?v=3","gravatar_id":"","url":"https://api.github.com/users/mrprescott","html_url":"https://github.com/mrprescott","followers_url":"https://api.github.com/users/mrprescott/followers","following_url":"https://api.github.com/users/mrprescott/following{/other_user}","gists_url":"https://api.github.com/users/mrprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/mrprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrprescott/subscriptions","organizations_url":"https://api.github.com/users/mrprescott/orgs","repos_url":"https://api.github.com/users/mrprescott/repos","events_url":"https://api.github.com/users/mrprescott/events{/privacy}","received_events_url":"https://api.github.com/users/mrprescott/received_events","type":"User","site_admin":false},"body":"I'm torn, but it crossed my mind to pull this into a separate little service that just provides a potentially format-specific ContentValidator.","created_at":"2015-05-27T09:54:11Z","updated_at":"2015-05-27T09:54:11Z","html_url":"https://github.com/sonatype/nexus-oss/pull/1338#discussion_r31118299","pull_request_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1338","_links":{"self":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments/31118299"},"html":{"href":"https://github.com/sonatype/nexus-oss/pull/1338#discussion_r31118299"},"pull_request":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1338"}}},"pull_request":{"url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1338","id":35924846,"html_url":"https://github.com/sonatype/nexus-oss/pull/1338","diff_url":"https://github.com/sonatype/nexus-oss/pull/1338.diff","patch_url":"https://github.com/sonatype/nexus-oss/pull/1338.patch","issue_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/1338","number":1338,"state":"open","locked":false,"title":"StorageTx improvements","user":{"login":"cstamas","id":45165,"avatar_url":"https://avatars.githubusercontent.com/u/45165?v=3","gravatar_id":"","url":"https://api.github.com/users/cstamas","html_url":"https://github.com/cstamas","followers_url":"https://api.github.com/users/cstamas/followers","following_url":"https://api.github.com/users/cstamas/following{/other_user}","gists_url":"https://api.github.com/users/cstamas/gists{/gist_id}","starred_url":"https://api.github.com/users/cstamas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstamas/subscriptions","organizations_url":"https://api.github.com/users/cstamas/orgs","repos_url":"https://api.github.com/users/cstamas/repos","events_url":"https://api.github.com/users/cstamas/events{/privacy}","received_events_url":"https://api.github.com/users/cstamas/received_events","type":"User","site_admin":false},"body":"Changes:\r\n- ability to save blobs ahead of touching any Orient entity (w/ cleanup support in TX scope)\r\n- filling in proper blob headers, like txPrincipal, name, etc, no need in various facets to have empty maps created\r\n- moved content validation to StorageTx (along with strictContentTypeValidation config)\r\n- open for custom content validation for format specific reqs\r\n- cleanup of some changes brought in by https://github.com/sonatype/nexus-oss/pull/1327\r\n- Maven2 specific file content validator (https://issues.sonatype.org/browse/NEXUS-8667)\r\n- UI change to migrate strictContentTypeValidation from various facets to StorageFacet\r\n\r\n\r\nCI\r\nhttp://bamboo.s/browse/NX3-OSSF330","created_at":"2015-05-21T11:37:35Z","updated_at":"2015-05-27T09:54:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e2fdc0988ce9d6b6ed66cebe628ede2321ea2a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1338/commits","review_comments_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1338/comments","review_comment_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/1338/comments","statuses_url":"https://api.github.com/repos/sonatype/nexus-oss/statuses/1ba25e91a8365ce9f1db35b3250c13f0b3ef3ba9","head":{"label":"sonatype:storagetx-improvements","ref":"storagetx-improvements","sha":"1ba25e91a8365ce9f1db35b3250c13f0b3ef3ba9","user":{"login":"sonatype","id":44938,"avatar_url":"https://avatars.githubusercontent.com/u/44938?v=3","gravatar_id":"","url":"https://api.github.com/users/sonatype","html_url":"https://github.com/sonatype","followers_url":"https://api.github.com/users/sonatype/followers","following_url":"https://api.github.com/users/sonatype/following{/other_user}","gists_url":"https://api.github.com/users/sonatype/gists{/gist_id}","starred_url":"https://api.github.com/users/sonatype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonatype/subscriptions","organizations_url":"https://api.github.com/users/sonatype/orgs","repos_url":"https://api.github.com/users/sonatype/repos","events_url":"https://api.github.com/users/sonatype/events{/privacy}","received_events_url":"https://api.github.com/users/sonatype/received_events","type":"Organization","site_admin":false},"repo":{"id":10146961,"name":"nexus-oss","full_name":"sonatype/nexus-oss","owner":{"login":"sonatype","id":44938,"avatar_url":"https://avatars.githubusercontent.com/u/44938?v=3","gravatar_id":"","url":"https://api.github.com/users/sonatype","html_url":"https://github.com/sonatype","followers_url":"https://api.github.com/users/sonatype/followers","following_url":"https://api.github.com/users/sonatype/following{/other_user}","gists_url":"https://api.github.com/users/sonatype/gists{/gist_id}","starred_url":"https://api.github.com/users/sonatype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonatype/subscriptions","organizations_url":"https://api.github.com/users/sonatype/orgs","repos_url":"https://api.github.com/users/sonatype/repos","events_url":"https://api.github.com/users/sonatype/events{/privacy}","received_events_url":"https://api.github.com/users/sonatype/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sonatype/nexus-oss","description":"Sonatype Nexus OSS","fork":false,"url":"https://api.github.com/repos/sonatype/nexus-oss","forks_url":"https://api.github.com/repos/sonatype/nexus-oss/forks","keys_url":"https://api.github.com/repos/sonatype/nexus-oss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonatype/nexus-oss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonatype/nexus-oss/teams","hooks_url":"https://api.github.com/repos/sonatype/nexus-oss/hooks","issue_events_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/events{/number}","events_url":"https://api.github.com/repos/sonatype/nexus-oss/events","assignees_url":"https://api.github.com/repos/sonatype/nexus-oss/assignees{/user}","branches_url":"https://api.github.com/repos/sonatype/nexus-oss/branches{/branch}","tags_url":"https://api.github.com/repos/sonatype/nexus-oss/tags","blobs_url":"https://api.github.com/repos/sonatype/nexus-oss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonatype/nexus-oss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonatype/nexus-oss/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonatype/nexus-oss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonatype/nexus-oss/statuses/{sha}","languages_url":"https://api.github.com/repos/sonatype/nexus-oss/languages","stargazers_url":"https://api.github.com/repos/sonatype/nexus-oss/stargazers","contributors_url":"https://api.github.com/repos/sonatype/nexus-oss/contributors","subscribers_url":"https://api.github.com/repos/sonatype/nexus-oss/subscribers","subscription_url":"https://api.github.com/repos/sonatype/nexus-oss/subscription","commits_url":"https://api.github.com/repos/sonatype/nexus-oss/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonatype/nexus-oss/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonatype/nexus-oss/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonatype/nexus-oss/contents/{+path}","compare_url":"https://api.github.com/repos/sonatype/nexus-oss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonatype/nexus-oss/merges","archive_url":"https://api.github.com/repos/sonatype/nexus-oss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonatype/nexus-oss/downloads","issues_url":"https://api.github.com/repos/sonatype/nexus-oss/issues{/number}","pulls_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls{/number}","milestones_url":"https://api.github.com/repos/sonatype/nexus-oss/milestones{/number}","notifications_url":"https://api.github.com/repos/sonatype/nexus-oss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonatype/nexus-oss/labels{/name}","releases_url":"https://api.github.com/repos/sonatype/nexus-oss/releases{/id}","created_at":"2013-05-18T20:48:57Z","updated_at":"2015-05-14T15:44:06Z","pushed_at":"2015-05-27T09:47:39Z","git_url":"git://github.com/sonatype/nexus-oss.git","ssh_url":"git@github.com:sonatype/nexus-oss.git","clone_url":"https://github.com/sonatype/nexus-oss.git","svn_url":"https://github.com/sonatype/nexus-oss","homepage":"http://links.sonatype.com/products/nexus/oss/home","size":897287,"stargazers_count":153,"watchers_count":153,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":101,"mirror_url":null,"open_issues_count":11,"forks":101,"open_issues":11,"watchers":153,"default_branch":"master"}},"base":{"label":"sonatype:master","ref":"master","sha":"f458320e70973c51219dc4c3dd9e8a26a1b60027","user":{"login":"sonatype","id":44938,"avatar_url":"https://avatars.githubusercontent.com/u/44938?v=3","gravatar_id":"","url":"https://api.github.com/users/sonatype","html_url":"https://github.com/sonatype","followers_url":"https://api.github.com/users/sonatype/followers","following_url":"https://api.github.com/users/sonatype/following{/other_user}","gists_url":"https://api.github.com/users/sonatype/gists{/gist_id}","starred_url":"https://api.github.com/users/sonatype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonatype/subscriptions","organizations_url":"https://api.github.com/users/sonatype/orgs","repos_url":"https://api.github.com/users/sonatype/repos","events_url":"https://api.github.com/users/sonatype/events{/privacy}","received_events_url":"https://api.github.com/users/sonatype/received_events","type":"Organization","site_admin":false},"repo":{"id":10146961,"name":"nexus-oss","full_name":"sonatype/nexus-oss","owner":{"login":"sonatype","id":44938,"avatar_url":"https://avatars.githubusercontent.com/u/44938?v=3","gravatar_id":"","url":"https://api.github.com/users/sonatype","html_url":"https://github.com/sonatype","followers_url":"https://api.github.com/users/sonatype/followers","following_url":"https://api.github.com/users/sonatype/following{/other_user}","gists_url":"https://api.github.com/users/sonatype/gists{/gist_id}","starred_url":"https://api.github.com/users/sonatype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonatype/subscriptions","organizations_url":"https://api.github.com/users/sonatype/orgs","repos_url":"https://api.github.com/users/sonatype/repos","events_url":"https://api.github.com/users/sonatype/events{/privacy}","received_events_url":"https://api.github.com/users/sonatype/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sonatype/nexus-oss","description":"Sonatype Nexus OSS","fork":false,"url":"https://api.github.com/repos/sonatype/nexus-oss","forks_url":"https://api.github.com/repos/sonatype/nexus-oss/forks","keys_url":"https://api.github.com/repos/sonatype/nexus-oss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonatype/nexus-oss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonatype/nexus-oss/teams","hooks_url":"https://api.github.com/repos/sonatype/nexus-oss/hooks","issue_events_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/events{/number}","events_url":"https://api.github.com/repos/sonatype/nexus-oss/events","assignees_url":"https://api.github.com/repos/sonatype/nexus-oss/assignees{/user}","branches_url":"https://api.github.com/repos/sonatype/nexus-oss/branches{/branch}","tags_url":"https://api.github.com/repos/sonatype/nexus-oss/tags","blobs_url":"https://api.github.com/repos/sonatype/nexus-oss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonatype/nexus-oss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonatype/nexus-oss/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonatype/nexus-oss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonatype/nexus-oss/statuses/{sha}","languages_url":"https://api.github.com/repos/sonatype/nexus-oss/languages","stargazers_url":"https://api.github.com/repos/sonatype/nexus-oss/stargazers","contributors_url":"https://api.github.com/repos/sonatype/nexus-oss/contributors","subscribers_url":"https://api.github.com/repos/sonatype/nexus-oss/subscribers","subscription_url":"https://api.github.com/repos/sonatype/nexus-oss/subscription","commits_url":"https://api.github.com/repos/sonatype/nexus-oss/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonatype/nexus-oss/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonatype/nexus-oss/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonatype/nexus-oss/contents/{+path}","compare_url":"https://api.github.com/repos/sonatype/nexus-oss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonatype/nexus-oss/merges","archive_url":"https://api.github.com/repos/sonatype/nexus-oss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonatype/nexus-oss/downloads","issues_url":"https://api.github.com/repos/sonatype/nexus-oss/issues{/number}","pulls_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls{/number}","milestones_url":"https://api.github.com/repos/sonatype/nexus-oss/milestones{/number}","notifications_url":"https://api.github.com/repos/sonatype/nexus-oss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonatype/nexus-oss/labels{/name}","releases_url":"https://api.github.com/repos/sonatype/nexus-oss/releases{/id}","created_at":"2013-05-18T20:48:57Z","updated_at":"2015-05-14T15:44:06Z","pushed_at":"2015-05-27T09:47:39Z","git_url":"git://github.com/sonatype/nexus-oss.git","ssh_url":"git@github.com:sonatype/nexus-oss.git","clone_url":"https://github.com/sonatype/nexus-oss.git","svn_url":"https://github.com/sonatype/nexus-oss","homepage":"http://links.sonatype.com/products/nexus/oss/home","size":897287,"stargazers_count":153,"watchers_count":153,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":101,"mirror_url":null,"open_issues_count":11,"forks":101,"open_issues":11,"watchers":153,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1338"},"html":{"href":"https://github.com/sonatype/nexus-oss/pull/1338"},"issue":{"href":"https://api.github.com/repos/sonatype/nexus-oss/issues/1338"},"comments":{"href":"https://api.github.com/repos/sonatype/nexus-oss/issues/1338/comments"},"review_comments":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1338/comments"},"review_comment":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1338/commits"},"statuses":{"href":"https://api.github.com/repos/sonatype/nexus-oss/statuses/1ba25e91a8365ce9f1db35b3250c13f0b3ef3ba9"}}}}