Re: Blind shot

Leo Mekenkamp <[email protected]>
Newsgroups gmane.comp.java.ozone.user
Message-ID <1079875385.3694.15.camel@jupiter>
On Sat, 2004-03-20 at 19:27, "Gonçalo E.D. Luiz" wrote:
> I've been reading Ozone Core code and I found out that MAYBE the issue 
> is comming from here:
> 
>    /**
>     * der aktuelle thread is auch die aktuelle transaktion (wenn der
>     * thread ueberhaupt eine transaktion ist)
>     */
>    public Transaction currentTA() {
>        Thread thread = Thread.currentThread();
>              // see startTransaction()
>        if (thread instanceof CommandThread) {
>            return ((CommandThread) thread).ta;
>        } else {
>            Transaction result = (Transaction) 
> threadTable.elementForKey(thread);
>            return result;
>        }
>    }
> 
> I will not try to translate the comment but I may guess that is saying 
> something about the "current thread and current transaction".

Fortunately Chris Zumbrunn already xlated that (thanx Chris).

> So my last mail maybe right. Ozone is trying to get the transaction on 
> the current thread, but because it is a new thread it has none ! Then at 
> Database.java when it does
> env.currentTA().xxxxx() we get the null pointer when trying to execute 
> xxxxxx().

Which is logical, because the ozone server has no way of knowing which
transaction a newly started thread should be bound to; every thread
needs its own transaction

> Is there a way to use thread like I'm trying to do ? Please say yes

:-/ I don't know. You are certainly doing stuff that is out of the
ordinary. Maybe it would be possible to start an external transaction
from within the server, but I don't know the consequences of that. Maybe
one of the more veteran developers can provide more inside on this.

Cheers,
Leo

-- 
    .--.      .---------------.----------------------------------------.
   |o_o |     | Leo Mekenkamp | Free, as in 'beer' and as in 'speech': |
   |:_/ |     | +31 641234919 | office software  http://openoffice.org |
  //   \ \    |               | 100% java odbms    http://ozone-db.org |
 (|     | )   | Long Live Tux | e-mail & browser    http://mozilla.org |
/'\_   _/`\   |               | operating system      http://linux.org |
\___)=(___/   `---------------'----------------------------------------'



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&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.