Re: transactions

Leo Mekenkamp <[email protected]>
Newsgroups gmane.comp.java.ozone.user
Message-ID <1078243069.28531.2.camel@mars>
While I think using external transactions is overkill in this situation
(and use of external transactions should be avoided if not explicitly
needed, implicit transactions are better and produce better readable
code), I cannot see any reason why this would go wrong.

Maybe one of the other people on this list?

Cheers,
Leo

On Tue, 2004-03-02 at 16:37, Sunil Goyal wrote:
> Hello leo,
> 
> Thanks for sorting out some of the issues. Finally
> I have been able to run some code of my application:-)
> 
> But one more issue still there :-)
> I am getting a stack overflow in a particular case.
>       [java] got local db
>       [java] WARN   [main] Transaction - ta[id=5102,blocker=null]: uncaught 
> exception: (java.lang.StackOverflowError)
>       [java] java.lang.StackOverflowError
>       [java] WARN   [main] Transaction - ta[id=5102,blocker=null]: uncaught 
> exception: (java.lang.StackOverflowError)
>       [java] java.lang.StackOverflowError
>       [java] java.lang.StackOverflowError
>       [java]     at 
> org.ozoneDB.ExternalDatabase.sendCommand(ExternalDatabase.java:536)
>       [java]     at 
> org.ozoneDB.ExternalDatabase.sendCommand(ExternalDatabase.java:485)
>       [java]     at 
> org.ozoneDB.ExternalDatabase.objectForName(ExternalDatabase.java:760)
>       [java]     at 
> org.cultos.ozstorage.mdwb.kdb.MdwbEmmoStorage.getRootEmmo(MdwbEmmoStorage.java:158)
> 
> 
> 
> I am creating a LocalDatabase , putting an object and rertieving that 
> object.
> 
> LocalDatabase db1;
> db1.open("/path/db");
> ExternalTransaction tr1 = db1.newTransaction();
> tr1.begin();
> Foo foo1 = (Foo)db1.createObject(FooImpl.class.getName(),0,"foo");
> foo1.setName("Foo 1");  // some operation on foo1
> 
> tr1.commit();
> db1.close();    // step_middle_1
> 
> db1.open("/path/db");   // step_middle_2
> ExternalTransaction tr2  = db1.newTransaction();
> tr2.begin();
> foo1 = (Foo)db1.objectForName("foo");  // get an error here..., stack 
> overflow
> System.out.println(foo1.getName());  // some operation of foo1
> tr2.commit();
> db1.close();
> 
> 
> Now suppose if I  don't close or open the database in between
> (step_middle_1 and step_middle_2) and just commit and open another
> transaction, then things are fine.
> 
> FooImpl and Foo are the classes with the defined Ozone interfaces
> for getting proxies.
> 
> Am I missing or doing something wrong over here in the
> code above? Thanks in advance. This is the last one for the day!!
> 
> Regards
> Sunil



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.