Furious George ha scritto:
> OK, you have mastered the basic Java course, but you obviously have no
> real working experience in the field. Otherwise you would know that if
> the supportsTransactions() method returns true, your database claims
> transaction support. You would know the difference between claiming
> transaction support and supporting transactions.
excuse me,but i don't understood what does mean...
now i've better understood my problem..,it's a strange problem....
I've tried to know if transactions are supported,and i've done this
[code]
Connection conn = dataSource.getConnection();
System.out.println(conn.getMetaData().supportsTransactions());
conn.setAutoCommit(false);
System.out.println("We are in autocommit
mode?"+conn.getAutoCommit());[/code]
in the console my application prints true to transaction support and
falso to autocommit mode.
That is there is support for transactions and i've disabled autocommit
mode,OK!
The problem is that when i execute the statements in my list it commit
each statement!
Why?
It doesn't wait form my commit or rollback,it commit each statemente!
Please help me,what i miss in my code?
Furious George - 09 Nov 2006 09:02 GMT
> Furious George ha scritto:
> > OK, you have mastered the basic Java course, but you obviously have no
[quoted text clipped - 23 lines]
> It doesn't wait form my commit or rollback,it commit each statemente!
> Please help me,what i miss in my code?
I am sorry for not being more explicit. I was disagreeing with the
previous poster's assertion that if the supportsTransactions() method
returns true, then the database supports transactions.
I meant that sometimes a database will claim that it supports
transactions when in fact it does not (or does not support them
correctly). If that is the case, then there is something wrong with
the database (not your code). This is sometimes called vaporware.
However, sorry for wasting your time on a technicality, but I do not
think this is your problem.
Rhino - 09 Nov 2006 14:22 GMT
> Furious George ha scritto:
>> OK, you have mastered the basic Java course, but you obviously have no
[quoted text clipped - 23 lines]
> It doesn't wait form my commit or rollback,it commit each statemente!
> Please help me,what i miss in my code?
I use MySQL regularly and turn off autoCommit most of the time; it only
commits when I want it to commit, not after each statement.
The problem is probably in the code that you don't show.
That is _NOT_ an invitation for you to post a long program (or send it to me
for my personal inspection!); I simply don't have the time for that.
Try stepping through your program with a good debugger and watch the
autoCommit status carefully. Perhaps you are turning autoCommit back on
after you turn it off. Or maybe you are doing things that cause commits that
aren't commit() statements. For example, in some relational databases,
reaching the normal end of a program without crashing causes all
uncommitted work to be committed even if you haven't coded a commit() at
that point.
--
Rhino
>> > Oliver Wong ha scritto:
>> >
[quoted text clipped - 26 lines]
> OK, you have mastered the basic Java course, but you obviously have no
> real working experience in the field.
Obviously?? I've been using relational databases - and teaching them
professionally - for over 20 years. Now don't you feel foolish?
> Otherwise you would know that if
> the supportsTransactions() method returns true, your database claims
> transaction support. You would know the difference between claiming
> transaction support and supporting transactions.
Actually I _do_ know the difference between claiming support and actually
providing it. I just haven't come across that many instances where vendors
claimed support that wasn't there. I made the assumption that MySQL was
being truthful in its claims. If you know that MySQL is lying (or
exaggerating) about supporting transactions, I will stand corrected. But
just the fact that some vendors occasionally fudge the truth about some
features of their systems does NOT prove that supportsTransactions() is
false in _this_ case.
--
Rhino
Furious George - 10 Nov 2006 00:21 GMT
> >> > Oliver Wong ha scritto:
> >> >
[quoted text clipped - 29 lines]
> Obviously?? I've been using relational databases - and teaching them
> professionally - for over 20 years. Now don't you feel foolish?
Actually, no. I was just nitpicking one statement. Don't take it
personally.
> > Otherwise you would know that if
> > the supportsTransactions() method returns true, your database claims
[quoted text clipped - 9 lines]
> features of their systems does NOT prove that supportsTransactions() is
> false in _this_ case.
I believe MySQL is trustworthy in this respect.
Sorry, for any offense given.
> --
> Rhino
Rhino - 10 Nov 2006 06:49 GMT
>> >> > Oliver Wong ha scritto:
>> >> >
[quoted text clipped - 35 lines]
> Actually, no. I was just nitpicking one statement. Don't take it
> personally.
Gee, how could I possibly be offended at you dismissing me as a rank newbie
when I have been working with databases for 20+ years?
>> > Otherwise you would know that if
>> > the supportsTransactions() method returns true, your database claims
[quoted text clipped - 14 lines]
>
> Sorry, for any offense given.
Okay.
--
Rhino