Subject Re: local transaction active can't begin another.
Author Roman Rokytskyy
> The exception I posted first appears to be related to an early
> NullPointerException. This early exception again is a mystery and I
> found one other post of this forum from someone with exactly the
> same problem. Someone suggested using the local transactions instead
> of xa transactions, I would like to understand the reason for this
> if anybody knows.

Reason is not local vs xa transactions, but whether you access server
using JCA framework or JDBC driver. Currently we do not have
XADataSource implementation, but I think I will manage to implement it
before release.

> The exception is shown below and appears to be a problem starting a
> new transaction is class GDS_Impl.
>
> I going to switch over to using a local jca-jdbc config instead of
> xa jca-jdbc config but feel I making changes blind :-(
>
> Again to re-iterate 99.9% of the transactions work, e.g. 30,000 will
> work and one or two will throw the following exception.

NPE happens in the following line:

db.out.writeInt(op_transaction);

This means that either "db" is null or "out" is null. "db" can be null
due to some bug? in JCA code (either driver, since it passed null
value or, JBoss, which caused driver to pass null value), "out" can be
null if connection was closed. This is not the first time I see this
bug when using JCA framework, but till now I did not see it when
accessing database via JCA.

If you are willing to invest some time into the project, you can
create XADataSource implementation using org.firebirdsql.pool.*
classes. Note that connection already implements XAResource interface,
so implementing XADataSource is a matter of probably one day max. For
me this would mean more, since I would need to set up test environment
(I do not use any app.server at home). If you have such env., then it
should be easy to test correctness of the implementation.

Best regards,
Roman Rokytskyy