Donate Share

Jaxor

Subscribe

JaxorTransaction issue

You are viewing a single message from this topic. View all messages.

  1. 2005-03-22 17:06:10 UTC
    Mike,
    first let me thank you for this nice framework, I'm (if I may say) long time user of jaxor - I've used it in one project couple years ago and now I come back for another project.

    I've hit an interesting issue with JaxorTransaction, anmely with its SingleConnectionTransaction -
    it looks like this implementation is not thread safe and it has causes some trouble with my multithreaded code. Maybe I did not get how it should be used.

    I've used JaxorSession setDefaultfactory with ContextFactory(new SingleConnectionTransaction(AConnectionFactory))

    What happen is that even though new Context was created for every thread it pointed to one SingleConnectionTransaction, which in turn pointed to one connection. You can imagine what mess it caused. it took me while to track it and now I'm thinking about how to fix it - what would be the best, you think?
    Make connection in SingleConnectionTransaction stored in ThreadLocal or make each thread to init JaxorSession with new SingleConnectionTransaction?
    Or am I missing something and there is an better solution.

    Kind regards
    Ivan
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.