Differences between revisions 2 and 3
Revision 2 as of 2005-09-05 06:28:08
Size: 1350
Editor: 195
Comment:
Revision 3 as of 2005-11-18 22:11:31
Size: 1611
Editor: 149
Comment:
Deletions are marked like this. Additions are marked like this.
Line 24: Line 24:

'''Question: 2:'''
Have you thought of integrating the file transaction with the JCA architecture, or enable it to work with the userTransaction.
There is a need in our application to coordinate a database write with file write.

thanks
Ankur Kapadia

I wrote the following code to create temp.txt in the stored directory But some file with a diff name(aW5kZXgxLnR4dA%3D%3D) gets created. Does someone know how to specify the name of the output file

  • Logger logger = Logger.getLogger("d:\\Raj\\test.log");

    LoggerFacade loggerFacade = new Log4jLogger(logger); FileResourceManager fileResourceManager =

    fileResourceManager.start(); String txId = fileResourceManager.generatedUniqueTxId(); System.out.println("Working Directory : " + fileResourceManager.getWorkDir()); System.out.println("Store Directory : " + fileResourceManager.getStoreDir()); System.out.println("Transaction Identifier : " + txId); fileResourceManager.startTransaction(txId);

    FileInputStream fis = new FileInputStream("D:\\Raj\\stored\\index.txt"); byte[] bt1 = new byte[100]; fis.read(bt1); fis.close(); OutputStream os = fileResourceManager.writeResource(txId, "temp.txt"); os.write(bt1); fileResourceManager.commitTransaction(txId);

Answer: You just need to disable urlEncoding: new FileResourceManager("D:\\Raj\\stored", "D:\\Raj\\working", false, loggerFacade );

Question: 2: Have you thought of integrating the file transaction with the JCA architecture, or enable it to work with the userTransaction. There is a need in our application to coordinate a database write with file write.

thanks Ankur Kapadia

Transaction (last edited 2009-09-20 23:48:10 by localhost)