Hi OK, I've tried to fix this about 3 different ways. Only one of them worked, and it caused a MASSIVE slowdown, so that's unacceptable. So I'm writing up my notes in case Thomas (or anyone else) has some better ideas.
This issue is related to the fix we did for https://code.google.com/p/h2database/issues/detail?id=315 We have an ABBA locking problem again, related to the order we synchronize on the Session and Database objects. Most of the time, we synchronize on the Session object first, and then the Database object, but in this case, because of the way LobStorage works, we are doing it the other way around, which is causing a deadlock. My research here has convinced me of some things (1) LobStorage should not be shared between SessionRemote and Database, it is just too confusing. It should be split into two classes, one for each purpose. (2) the new DatabaseLobStorage class should use the current Session object instead of the system Session object when updating tables . This will be good for performance because multiple LOB updates can then proceed in parallel. And less prone to deadlock. (3) We mostly lock on the current Session, but sometimes we decide to execute things in the context of the system Session object, which is just asking for a deadlock to happen. I think we should have some kind of ExecutorService to which we push tasks which need to run on the system Session. (4) And then we can stop synchronizing on Session, because it will only ever be accessed from one TcpServerThread at a time. Most of the current locking appears to be there because we are accessing the system Session from lots of other threads. Dropping this locking should be simpler, less prone to deadlock, and faster. Regards, Noel Grandin On 2013-05-05 04:33, Ainimyoung wrote: > Hi Noel, > > Thanks for replying. > The URL is jdbc:h2:tcp://ip:9092/db > We've also tried MULTI_THREAD=TRUE but no help. > > Best Regards > > Noel Grandin於 2013年5月4日星期六UTC+8下午7時25分59秒寫道: > > What does your database URL look like? > > -- > You received this message because you are subscribed to the Google > Groups "H2 Database" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/h2-database?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
