jms-jpa/src/main/java/org/acme/DummyXAResource.java [143:164]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private File writeXidToFile(Xid xid, String directory) throws XAException {
        File dir = new File(directory);

        if (!dir.exists() && !dir.mkdirs()) {
            throw new XAException(XAException.XAER_RMERR);
        }

        File file = new File(dir, new Uid().fileStringForm() + "_");

        try (DataOutputStream outputStream = new DataOutputStream(new FileOutputStream(file))) {
            outputStream.writeInt(xid.getFormatId());
            outputStream.writeInt(xid.getGlobalTransactionId().length);
            outputStream.write(xid.getGlobalTransactionId(), 0, xid.getGlobalTransactionId().length);
            outputStream.writeInt(xid.getBranchQualifier().length);
            outputStream.write(xid.getBranchQualifier(), 0, xid.getBranchQualifier().length);
            outputStream.flush();
        } catch (IOException e) {
            throw new XAException(XAException.XAER_RMERR);
        }

        return file;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



jta-jpa/src/main/java/org/acme/DummyXAResource.java [143:164]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private File writeXidToFile(Xid xid, String directory) throws XAException {
        File dir = new File(directory);

        if (!dir.exists() && !dir.mkdirs()) {
            throw new XAException(XAException.XAER_RMERR);
        }

        File file = new File(dir, new Uid().fileStringForm() + "_");

        try (DataOutputStream outputStream = new DataOutputStream(new FileOutputStream(file))) {
            outputStream.writeInt(xid.getFormatId());
            outputStream.writeInt(xid.getGlobalTransactionId().length);
            outputStream.write(xid.getGlobalTransactionId(), 0, xid.getGlobalTransactionId().length);
            outputStream.writeInt(xid.getBranchQualifier().length);
            outputStream.write(xid.getBranchQualifier(), 0, xid.getBranchQualifier().length);
            outputStream.flush();
        } catch (IOException e) {
            throw new XAException(XAException.XAER_RMERR);
        }

        return file;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



