I have a process which requires an extreme amount of overhead to manage with OJB that would be so simple to do in straight SQL. I'm hoping some OJB specialists can help me figure out how to tune this process.

For an application, we have a number of users who can log in to operate on behalf of their organizations. In the object model, there are two relevant objects: the organization (org for short) and the org-agent. The org is a fairly rich object, while the org-agent is merely the relationship between the agent's ID (a string) and the org itself.

I periodically get a data feed which essentially just maps agent ids to organization ids. In SQL, I'd just manage a single two-column table directly, and the process would be done in a matter of minutes. (About five minutes using a script I've written) However, in OJB, I seem to be dragging these heavy "org" objects around with everything I want to do, and it makes the thing take more like five hours.

I'm thinking that I could just run the direct-SQL script instead of using OJB, and then signal the application that its cache of these objects may be invalid. This is probably safe, in a practical sense, since the process is much more likely to insert new objects than change old ones, but I can't be certain of that.

The alternative would be to figure out a way to get OJB to accept updates to objects that may or may not have been loaded yet without performing a full load for each. I'm not totally clear on how OJB functions here either, but I think that if I make a new object with the same ID (primary key) as one for which OJB already has a cached instance, then OJB isn't real happy. Maybe I'm writing my tests wrong, but a few things I did to try to test this seem to bear it out.

Any advice or insight into how to achieve this best would be greatly appreciated...

Thanks
        Joe

--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"We want beef in dessert if we can get it there."
-- Betty Hogan, Director of New Product Development, National Cattlemen's Beef Association



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to