Re: Blind shot

Per Nyfelt <[email protected]>
Newsgroups gmane.comp.java.ozone.user
Organization Resourcing Networks
Message-ID <[email protected]>
I do not use threaded apps myself very often but here:s some information that 
might be useful:

1. It is not possible to use threads on the server side (in Ozone Objects)

2. If the client is threaded then use a common OzoneInterface, opening a new 
database to get an OzoneInterface for each thread will give you problems.

3. In the package test.tx you can see some simple examples of thread use that 
might be useful.

Best regards,
Per

söndagen den 21 mars 2004 14.23 skrev Leo Mekenkamp:
> 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



-------------------------------------------------------
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.