Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle: Java + distributed transactions (CORBA OTS + 2PC)
Hi,
[Answer also takes into account your followup posting]
Klaus Hildner wrote:
>
> Hello world,
>
> is there anybody out there who can give me a hint on how to drive an
> Oracle server from a Java program; I do not need the usual JDBC
> query/update functionality but the possibility to drive an XA-like
> two-phase commit (2PC) protocol.
Currently JDBC does not support 2PC. JDBC 2.0 has support for 2PC.
However, this is optional for JDBC 2.0 drivers and AFAIK there is
no implementation of this avaible at the moment. There is a
specification
to support XA (see http://java.sun.com/products/jta/ ). Again I am
not sure wether there are any implementations for this.
Most likely Inprise itself will support 2PC in VisiBroker ITS as soon as there are good JDBC 2.0 drivers. This should not be too complicated.
> I am currently working on my diploma thesis and have developed a
> skeleton manufacturing execution system MES with Java (JBuilder) and
> CORBA (VisiBroker). Currently, the resource part is simulated in memory,
> but it takes part in transaction completion via the OTS-coordinator's
> prepare(), commit(), commit_one_phase(), and rollback() methods.
>
> Important for me is a mechanism that lets a resource alternatingly join
> several transaction branches, i. e. the resource should work on part of
> one transaction, then on part of another, and some time later commit the
> first one and some time later maybe rollback the second one. This could
> be done by connection pooling and JDBC, I think. But it is a problem to
> get the prepare() functionality for the 2PC which is very important for
> consistent, distributed updates.
As pointed out above there seems to be no way to do that using Java.
Your postings imply that you so have VisiBroker ITS. Please note that VisiBroker ITS has 2PC for Oracle if you use C++. This also gives you connection pooling etc. for free. Instead of programming 2PC for Oracle yourself I would consider writing the Oracle dependend parts in C++. You can have your Java application talking to C++ using VisiBroker.
Hope this helps,
Eberhard
--
Eberhard Wolff http://vsys-www.informatik.uni-hamburg.de/~3wolff University of Hamburg Phone: +49 (0) 177 560 47 11Received on Mon Aug 23 1999 - 11:07:33 CDT