This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes Locking on multiple simultaneous inserts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Locking on multiple simultaneous inserts" Watch "Locking on multiple simultaneous inserts" New topic
Author

Locking on multiple simultaneous inserts

Onkar Joshi
Ranch Hand

Joined: Mar 01, 2007
Posts: 116
I am reading messages from a JMS queue. Each message from the queue translates to an insert on a table that has no index and no PK.

My problem is that the inserts are getting serialized resulting in messages being consumed very slowly. (While messages are put into the queue much faster)

So are inserts on a table always serialized or under certain conditions? What?

Would appreciate any insight here!


SCJP 5 - 95% | SCWCD 1.4 - 88% | SCBCD 5 - 93%
Onkar Joshi's blog | LinkedIn profile
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30353
    
150

Onkar,
What are your settings? In particular, the transactions settings and the number of current messages being taken off the queue.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Casttro Francis
Greenhorn

Joined: Oct 08, 2008
Posts: 25
I agree that the MDB will pick a message from the Queue Asynchronously. Use data source for better performance

And the important thing here for Performance

1. Try to develop a PL SQL package and insert messages Using a bulk insert. And the PL SQL package using Callable stmt.
2. Or use Execute Update.

If this not suits your requirement. Explain more detail about your requirements.


Any fool can write code that a computer can understand. Good programmers write code that humans can understand....
Onkar Joshi
Ranch Hand

Joined: Mar 01, 2007
Posts: 116
We managed a huge boost in performance by using multiple partitions for our target table.

I agree there are other things that can be done for further improvements. But the one above required almost no effort on our part other than finding out that doing that would improve things.
 
 
subject: Locking on multiple simultaneous inserts