|
Posted by Erland Sommarskog on 09/15/06 21:46
dunleav1 (jmd@dunleavyenterprises.com) writes:
> dunleav1 wrote:
>> > It's hard to explain the I/O disparity without knowing the details of
>> > your job. My first guess is that you might be committing each SQL
>> > Server insert (default is autocommit) but not each Oracle insert
>> > (default is implicit transactions on). This would require SQL Sever
>> > to perform many more transaction log writes.
>> >
>> Can you explain this paragraph a little more. I'm not a java guy.
>> Thanks for your help.
>
> Looking at the java code- autocommit is set to false using the
> setAutoCommit class.
First of all, if you want more precise answer, it helps if you post
your code. At the moment, we are only guessing.
On SQL Server the default behaviour is that each statement is a separate
transaction. If you want all to be one transaction, you have to start
an explicit transaction with BEGIN TRANSACTION. Or you can use SET
IMPLICIT_TRANSACTIONS ON, which means that a DML statement will start
a transaction that you will need to explicit commit later.
Maybe that happens with your Java thing when you set AutoCommit to false -
I have no experience with Java programming or APIs for Java. But
personally I feel that no matter the engine, explicit transactions
are better than relying on implicit transactions.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|