neo4j-wrapper 2.2.1-java → 2.2.3-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@ This gem is included in neo4j.
14
14
 
15
15
  {Neo4j::RelationshipMixin} The Java Relationship
16
16
 
17
- {Neo4j::IdentityMap} The Identity Map
17
+ {Neo4j::IdentityMap} The Identity Map (should be disabled for batch imports and Rake scripts)
18
18
 
19
19
  == Example
20
20
 
@@ -60,12 +60,13 @@ module Neo4j
60
60
  #
61
61
  # node = MyNode.get_or_create(:email =>'jimmy@gmail.com', :name => 'jimmy')
62
62
  #
63
+ # @note It must not be called in a transaction. It will create and finish a new transaction.
63
64
  # @see #put_if_absent
64
65
  def get_or_create(*args)
65
66
  props = args.first
66
67
  raise "Can't get or create entity since #{props.inspect} does not included unique key #{props[unique_factory_key]}'" unless props[unique_factory_key]
67
68
  index = index_for_type(_decl_props[unique_factory_key][:index])
68
- Neo4j::Core::Index::UniqueFactory.new(unique_factory_key, index) { |*| new(*args) }.get_or_create(unique_factory_key, props[unique_factory_key])
69
+ Neo4j::Core::Index::UniqueFactory.new(unique_factory_key, index) { |*| new(*args) }.get_or_create(unique_factory_key, props[unique_factory_key]).wrapper
69
70
  end
70
71
 
71
72
  # @throws Exception if there are more then one property having unique index
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Wrapper
3
- VERSION = '2.2.1'
3
+ VERSION = '2.2.3'
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Wrapper
3
- VERSION = '2.1.0'
3
+ VERSION = '2.2.2'
4
4
  end
5
5
  end
@@ -8,13 +8,19 @@ module Neo4j
8
8
  # More information on Identity Map pattern:
9
9
  # http://www.martinfowler.com/eaaCatalog/identityMap.html
10
10
  #
11
+ # The identity map cache is cleared after each transaction. When used from rails the Rack Middle ware
12
+ # will also make sure that the cache is emptied after each request.
13
+ #
14
+ # When used from batch import scripts (e.g. Rake) you should probably disable the identity map,
15
+ # because the identity map cache will not be used (the same object is not loaded more than once).
16
+ # If not used from rails and transactions does not occur then the cache will never be cleared and
17
+ # you will have a memory leak.
18
+ #
11
19
  # == Configuration
12
20
  #
13
21
  # In order to enable IdentityMap, set <tt>config.neo4j.identity_map = true</tt>
14
22
  # in your <tt>config/application.rb</tt> file. If used outside rails, set Neo4j::Config[:identity_map] = true.
15
23
  #
16
- # IdentityMap is disabled by default and still in development (i.e. use it with care).
17
- #
18
24
  module IdentityMap
19
25
 
20
26
  class << self
@@ -214,9 +214,10 @@ module Neo4j
214
214
  end
215
215
 
216
216
  # Converts the given DateTime (UTC) value to an Fixnum.
217
- # Only utc times are supported !
217
+ # DateTime values are automatically converted to UTC.
218
218
  def to_java(value)
219
219
  return nil if value.nil?
220
+ value = value.new_offset(0) if value.respond_to?(:new_offset)
220
221
  if value.class == Date
221
222
  Time.utc(value.year, value.month, value.day, 0, 0, 0).to_i
222
223
  else
@@ -274,7 +275,7 @@ module Neo4j
274
275
  def converters=(converters)
275
276
  @converters = converters
276
277
  end
277
-
278
+
278
279
  # Always returns a converter that handles to_ruby or to_java
279
280
  # if +enforce_type+ is set to false then it will raise in case of unknown type
280
281
  # otherwise it will return the DefaultConverter.
@@ -27,5 +27,5 @@ It comes included with the Apache Lucene document database.
27
27
  s.extra_rdoc_files = %w( README.rdoc )
28
28
  s.rdoc_options = ["--quiet", "--title", "Neo4j.rb", "--line-numbers", "--main", "README.rdoc", "--inline-source"]
29
29
 
30
- s.add_dependency("neo4j-core", "2.2.1")
30
+ s.add_dependency("neo4j-core", "2.2.3")
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.3
5
5
  prerelease:
6
6
  platform: java
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-17 00:00:00.000000000 Z
12
+ date: 2012-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: neo4j-core
@@ -17,13 +17,13 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 2.2.1
20
+ version: 2.2.3
21
21
  none: false
22
22
  requirement: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.1
26
+ version: 2.2.3
27
27
  none: false
28
28
  prerelease: false
29
29
  type: :runtime