Kod:
t = DataMapper::Transaction.new(App::Data::TestType)
t.begin
App::Data::TestType.create(:name => "Ogólne")
t.rollback
wywala błąd:
Transaction.java:125:in `getConnection': java.lang.NullPointerException
from Transaction.java:64:in `begin'
from data_objects/Transaction$i_method_0_0$RUBYINVOKER$begin.gen:-1:in `call'
from JavaMethod.java:651:in `call'
from RubyClass.java:432:in `finvoke'
from RubyObject.java:1436:in `send'
from org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen:-1:in `call'
from JavaMethod.java:259:in `call'
from CachingCallSite.java:310:in `cacheAndCall'
from CachingCallSite.java:149:in `call'
from CallOneArgNode.java:57:in `interpret'
from NewlineNode.java:104:in `interpret'
from BlockNode.java:71:in `interpret'
from InterpretedMethod.java:247:in `call'
from DefaultMethod.java:201:in `call'
from CachingCallSite.java:350:in `cacheAndCall'
from CachingCallSite.java:229:in `call'
from FCallThreeArgNode.java:40:in `interpret'
from NewlineNode.java:104:in `interpret'
from InterpretedMethod.java:192:in `call'
from DefaultMethod.java:177:in `call'
from RubyClass.java:472:in `finvoke'
from RubyObject.java:1442:in `send'
from org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen:-1:in `call'
from JavaMethod.java:276:in `call'
from CachingCallSite.java:187:in `call'
from CallTwoArgNode.java:59:in `interpret'
from NewlineNode.java:104:in `interpret'
from InterpretedBlock.java:317:in `evalBlockBody'
from InterpretedBlock.java:216:in `yieldSpecific'
from Block.java:117:in `yieldSpecific'
from RubyHash.java:1071:in `visit'
from RubyHash.java:576:in `visitAll'
from RubyHash.java:1058:in `iteratorVisitAll'
from RubyHash.java:1069:in `each'
from RubyHash.java:1089:in `each19'
from org/jruby/RubyHash$i_method_0_0$RUBYFRAMEDINVOKER$each19.gen:-1:in `call'
from CachingCallSite.java:116:in `callBlock'
from CachingCallSite.java:123:in `call'
from CallNoArgBlockNode.java:64:in `interpret'
from NewlineNode.java:104:in `interpret'
from RescueNode.java:225:in `executeBody'
from RescueNode.java:147:in `interpretWithJavaExceptions'
from RescueNode.java:110:in `interpret'
from BeginNode.java:83:in `interpret'
from NewlineNode.java:104:in `interpret'
~ (0,000) SELECT "id", "name", "type_id" FROM "test" WHERE "id" = 36 ORDER BY "id" LIMIT 1
OB
from InterpretedMethod.java:210:in `call'
nil
from DefaultMethod.java:185:in `call'
~ default: begin
from CachingCallSite.java:330:in `cacheAndCall'
from CachingCallSite.java:189:in `call'
from FCallTwoArgNode.java:38:in `interpret'
from NewlineNode.java:104:in `interpret'
from BlockNode.java:71:in `interpret'
from InterpretedMethod.java:136:in `call'
from DefaultMethod.java:153:in `call'
from CachingCallSite.java:290:in `cacheAndCall'
from CachingCallSite.java:109:in `call'
from main.rb:49:in `__file__'
from main.rb:-1:in `load'
from Ruby.java:628:in `runScript'
from Ruby.java:550:in `runNormally'
from Ruby.java:396:in `runFromMain'
from Main.java:272:in `run'
from Main.java:117:in `run'
from Main.java:97:in `main'