MDB related question

I am a newbie in EJB. I have a MDB related question where I have to add some funtionality to an existing application which process a XML input file using the JAXB API. Currently, the input xml file contains with the header information a single record content. The MDB starts with other class methods to parse this XML object. Now, I have to add the funtionality to process a xml file with the header will have multiple records. Wondering if I could parse this new XML input in the format applicable for the existing JAXB generated classes that gets called within the existing MDB's method? Also, like to understand what would be the best way to have some sort of parallel processing of these split XML messages? I guess implementing any sort of multithreading mechanism in EJB could be a no no. Or the MDB itself would take care of this? By the way, I am using JDK 1.3, EJB 2.0.

Generally you don't parse the messages yourself, you use the generated tools for both the MDB client and server. You might want to consider a web service if parsing/handling the messages manually is more desirable since they tend to have easier to read and publicly available definitions. If you want to do parallel processing, for example, read the api's of the tools you are using to figure out how to do so.

Also keep in mind the classic debate between sax and dom parsers in xml. For example, if you want to load the entire file into memory and parse it in parallel, DOM would be the winner, but if the file is too big, you can set multiple sax parsers on it to handle each piece separately.