aspose file tools*
The moose likes I/O and Streams and the fly likes Multiple Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Multiple Transactions" Watch "Multiple Transactions" New topic
Author

Multiple Transactions

Patrick Boos
Greenhorn

Joined: Sep 09, 2008
Posts: 15
Hello,

I am trying to allow my program to accept multiple transaction records. I have created a file creator (CreateData) to populate two text files (oldmast.txt, trans.txt). CreateData will need to be run to create these two files. I have also created a file matching class (FileMatch) to process and write the processed information to newmast.txt and log the unnecessary transactions to log.txt. FileMatchTest will need to be ran to process the files. The problem that I am having is that my program will not allow multiple transactions. Specifically transactions[4], transactions[5], and transactions[6]. In theory, my newmast.txt file should have all the accounts listed with the correct balances. Can anyone give me any pointers for how to accomplish this? Thank you.




[ September 09, 2008: Message edited by: Patrick Boos ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

Welcome to the JavaRanch. You would do well to read our FAQ: How To Ask Questions On JavaRanch, in particular, Isolate The Problem.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Patrick Boos
Greenhorn

Joined: Sep 09, 2008
Posts: 15
Basically, I am running into a problem combining the transactions as they are read through the FileMatch class. I have a combine method in AccountRecord that is called in the processFiles method in FileMatch. It combines the first two transactions with the account records, but it does not combine the final three. To isolate the problem, I believe the problem lies in my processFiles() method in the FileMatch class. I would just appreciate some guidance for how to accomplish combining all of the records into the newmast.txt file. Any help is appreciated. Also, I don�t know what happened, but my code posted twice for some classes. Should I repost it? Thank you.
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Originally posted by Patrick Boos:
Also, I don�t know what happened, but my code posted twice for some classes. Should I repost it? Thank you.


You can edit your post by clicking on [url=]this image[/url](i find that the insert image option is missing from the editor so i have to give you the link to the image) on top of your post.
[ September 09, 2008: Message edited by: Nitesh Kant ]

apigee, a better way to API!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

Originally posted by Patrick Boos:
my code posted twice for some classes.


You can edit your post by clicking on the icon that looks like a pencil and paper next to the post time: However, removing the duplicate code still leaves hundreds of lines. You need to trim this down to part that's causing you the problem. Can you reproduce your problem in 10 or 20 lines of code?

[ September 09, 2008: Message edited by: Joe Ess ]
[ September 09, 2008: Message edited by: Joe Ess ]
Patrick Boos
Greenhorn

Joined: Sep 09, 2008
Posts: 15
Thank you Nitesh and Joe. I wish I could reproduce in 10-20 lines of code. I can't seem to pinpoint the problem as some of the accounts get updated and others do not. I think the problem lies in the FileMatch class, so I edited my original post to only show that class. The processFiles() method is where the accounts are compared, but there are other methods within the class that may be helpful to look at as well. Thanks.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

That's still too much code for me. Maybe someone with more free time will happen along.
In the mean time, my advice is to throw in a bunch of logging statements at crucial intervals (I usually log method calls and the results of important logical branches). Then you can observe what your program is doing and figure out how that differs from your expectations.
Patrick Boos
Greenhorn

Joined: Sep 09, 2008
Posts: 15
Ok, thank you for taking the time to look at it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Transactions