You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Bing Lu <mf...@yahoo.com> on 2006/08/01 22:18:58 UTC
daomanager doesn't rollback transaction?
Hi, I'm using daomanager transactions. what I did was
start a transaction, do couple inserts and a delete
and some more inserts, the problem I have is after
deletion, my insert threw an exception and didn't
finish inserting all the stuff, at this point the
daomanager should rollback to earlier stage(prior to
delete) but when I checked the database, I see the
rows have already been deleted which means the
transaction didn't rollback. Am I doing something
wrong?
thanks
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: daomanager doesn't rollback transaction?
Posted by Larry Meadors <lm...@apache.org>.
Are you using MySQL?
Larry
On 8/1/06, Bing Lu <mf...@yahoo.com> wrote:
> Hi, I'm using daomanager transactions. what I did was
> start a transaction, do couple inserts and a delete
> and some more inserts, the problem I have is after
> deletion, my insert threw an exception and didn't
> finish inserting all the stuff, at this point the
> daomanager should rollback to earlier stage(prior to
> delete) but when I checked the database, I see the
> rows have already been deleted which means the
> transaction didn't rollback. Am I doing something
> wrong?
>
> thanks
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
Re: daomanager doesn't rollback transaction?
Posted by Bing Lu <mf...@yahoo.com>.
i'm using oracle9, and my code is just like the code
in the javadoc, I will post the code tomorrow thanks
--- Jeff Butler <je...@gmail.com> wrote:
> iBATIS transactions work well for many people every
> day - so it is highly
> likely that your code is in error.
>
> If you want us to debug your code, you're going to
> have to give us more
> information. So, as Larry already asked, are you
> using MySQL?
>
> And, can we see some of your code? Expecially the
> code that controls the
> transaction and calls other methods. I know you've
> asked before about this
> on the list, but you've never provided enough
> information for us to help
> you.
>
> Jeff Butler
>
>
> On 8/1/06, Bing Lu <mf...@yahoo.com> wrote:
> >
> > anybody? no one had this issue before? or what am
> i
> > doing wrong?
> >
> > --- Bing Lu <mf...@yahoo.com> wrote:
> >
> > > Hi, I'm using daomanager transactions. what I
> did
> > > was
> > > start a transaction, do couple inserts and a
> delete
> > > and some more inserts, the problem I have is
> after
> > > deletion, my insert threw an exception and
> didn't
> > > finish inserting all the stuff, at this point
> the
> > > daomanager should rollback to earlier
> stage(prior to
> > > delete) but when I checked the database, I see
> the
> > > rows have already been deleted which means the
> > > transaction didn't rollback. Am I doing
> something
> > > wrong?
> > >
> > > thanks
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam? Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: daomanager doesn't rollback transaction?
Posted by Jeff Butler <je...@gmail.com>.
iBATIS transactions work well for many people every day - so it is highly
likely that your code is in error.
If you want us to debug your code, you're going to have to give us more
information. So, as Larry already asked, are you using MySQL?
And, can we see some of your code? Expecially the code that controls the
transaction and calls other methods. I know you've asked before about this
on the list, but you've never provided enough information for us to help
you.
Jeff Butler
On 8/1/06, Bing Lu <mf...@yahoo.com> wrote:
>
> anybody? no one had this issue before? or what am i
> doing wrong?
>
> --- Bing Lu <mf...@yahoo.com> wrote:
>
> > Hi, I'm using daomanager transactions. what I did
> > was
> > start a transaction, do couple inserts and a delete
> > and some more inserts, the problem I have is after
> > deletion, my insert threw an exception and didn't
> > finish inserting all the stuff, at this point the
> > daomanager should rollback to earlier stage(prior to
> > delete) but when I checked the database, I see the
> > rows have already been deleted which means the
> > transaction didn't rollback. Am I doing something
> > wrong?
> >
> > thanks
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
Re: daomanager doesn't rollback transaction?
Posted by Debasish Dutta Roy <de...@gmail.com>.
Though there are several possible solutions already mentioned. Let me tell
you about my experience. I had exactly the same problem.
My problem was, with this setup I was still using sqlMapClient in the dao
implementation classes.
i.e. inside this.myDao.updateParent(p); I had sqlMapClient.udpate, I did not
realize that was starting another transaction, all indiviual ones. So what I
had to do was just do this.update(p); inside the dao classes.
On 8/2/06, Jeff Butler <je...@gmail.com> wrote:
>
> Yes - I think that's exactly the problem - too many transaction managers
> all not talking to each other. Who's in control - SqlMap, DAO, Spring, or
> WebSphere?
>
> If you have transaction manager set to EXTERNAL, then the DAO and SqlMap
> transaction methods are ignored.
>
> With WebSphere, you should use external if you are using a session bean
> facade, otherwise external is probably not what you want. But it also
> sounds like you want to use spring, so in that case you don't need iBATIS
> DAO manager.
>
> Jeff Butler
>
>
> On 8/2/06, Chris Lamey <cl...@localmatters.com> wrote:
> >
> > If you have an external transaction manager set up, the *Transaction
> > calls are effectively ignored because you've told iBATIS to leave things up
> > to the external manager.
> >
> > Are you intending to use Websphere as the external manager or Spring?
> >
> > I don't know much about Websphere, but for Spring you would need to
> > configure the transaction handling in your application context. The easiest
> > way, which requires no Java code changes, is through declarative
> > transactions:
> >
> > http://static.springframework.org/spring/docs/1.2.x/reference/transaction.html#d0e5690
> >
> >
> > The various txn options are defined here:
> >
> >
> > http://static.springframework.org/spring/docs/2.0-m3/api/org/springframework/transaction/TransactionDefinition.html
> >
> > The basic idea is that you wrap your DAO bean with a
> > TransactionProxyFactoryBean and configure it to use transactions on the
> > methods you want to handle as transactions. Then Spring intercepts calls to
> > the DAO and treats them as transactions according to how you've configured
> > things.
> >
> > Cheers,
> >
> > Chris
> >
> > -----Original Message-----
> > From: Bing Lu [mailto:mfcplus@yahoo.com <mf...@yahoo.com>]
> > Sent: Wed 8/2/2006 7:34 AM
> > To: user-java@ibatis.apache.org
> > Subject: RE: daomanager doesn't rollback transaction?
> >
> > I'm using oracle9 with ibatis sqlmap 2.1.7 and
> > deploying on websphere application server and have the
> > transaction set as external and I'm using spring 2.0
> > following is my code for the transaction. It's able to
> > delete but when an exception is thrown after deletion,
> > it doesn't rollback, looking forward to your opinions
> >
> > thanks
> >
> > try
> > {
> > this.daoManager.startTransaction ();
> > this.myDao.updateParent(p);
> > this.myDao.deleteChildren(p.getSeqNum());
> >
> > if(p.getChildren() != null && p.getChildren().size()
> > >0)
> > {
> > for (Iterator it=p.getChildren().iterator();
> > it.hasNext(); )
> > {
> > Child child= (Child)it.next();
> > child.setParentSeqNum( p.getSeqNum());
> > this.myDao.insertChild(child);
> > }
> > }
> > this.daoManager.commitTransaction();
> > }
> > finally
> > {
> > this.daoManager.endTransaction();
> > }
> >
> > --- Chris Lamey <cl...@localmatters.com> wrote:
> >
> > > Hello,
> > >
> > > In general, at a very high level, it is safe to say
> > > that transactions in iBATIS work. Lots of people
> > > are using them regularly without any problems with
> > > the right RDBMS configured correctly. For example,
> > > my group successfully uses iBATIS 2.1.7 with
> > > Postgres 8.x and Spring's declarative transaction
> > > manager.
> > >
> > > However, it's hard to say whether or not anyone's
> > > had the issue you're seeing when there isn't much
> > > background information on your problem. From what
> > > I've seen on this list, people generally get help if
> > > they send along this information along with their
> > > issue:
> > >
> > > - Vendor and version of RDBMS (Postgres 8.0, Oracle
> > > 10g, etc)
> > > - Version of iBATIS DataMapper and/or DAOs
> > > - Version of Java
> > > - Operation system type and version of the RDBMS and
> > > application
> > > - Deployment environment (standalone main
> > > application, Tomcat, JBoss, Webshere, BEA, etc)
> > > - (If applicable) Version of Abator
> > > - (If applicable) Version of Spring
> > > - Snippet of your sqlmap config file, specifically
> > > the settings and, if applicable, transactionManager
> > > elements
> > > - A write up of expection for transaction
> > > management, specifically if you're expecting iBATIS
> > > to do it or an external manager. If it's an
> > > external manager, what is it and how is it
> > > configured.
> > >
> > > Thanks,
> > > Chris
> > >
> > > -----Original Message-----
> > > From: Bing Lu [ mailto:mfcplus@yahoo.com <mf...@yahoo.com>]
> > > Sent: Tue 8/1/2006 8:56 PM
> > > To: user-java@ibatis.apache.org
> > > Subject: Re: daomanager doesn't rollback
> > > transaction?
> > >
> > > anybody? no one had this issue before? or what am i
> > > doing wrong?
> > >
> > > --- Bing Lu < mfcplus@yahoo.com> wrote:
> > >
> > > > Hi, I'm using daomanager transactions. what I did
> > > > was
> > > > start a transaction, do couple inserts and a
> > > delete
> > > > and some more inserts, the problem I have is after
> > > > deletion, my insert threw an exception and didn't
> > > > finish inserting all the stuff, at this point the
> > > > daomanager should rollback to earlier stage(prior
> > > to
> > > > delete) but when I checked the database, I see the
> > > > rows have already been deleted which means the
> > > > transaction didn't rollback. Am I doing something
> > > > wrong?
> > > >
> > > > thanks
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam? Yahoo! Mail has the best spam
> > > > protection around
> > > > http://mail.yahoo.com
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam? Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
>
Re: daomanager doesn't rollback transaction?
Posted by Jeff Butler <je...@gmail.com>.
Yes - I think that's exactly the problem - too many transaction managers all
not talking to each other. Who's in control - SqlMap, DAO, Spring, or
WebSphere?
If you have transaction manager set to EXTERNAL, then the DAO and SqlMap
transaction methods are ignored.
With WebSphere, you should use external if you are using a session bean
facade, otherwise external is probably not what you want. But it also
sounds like you want to use spring, so in that case you don't need iBATIS
DAO manager.
Jeff Butler
On 8/2/06, Chris Lamey <cl...@localmatters.com> wrote:
>
> If you have an external transaction manager set up, the *Transaction
> calls are effectively ignored because you've told iBATIS to leave things up
> to the external manager.
>
> Are you intending to use Websphere as the external manager or Spring?
>
> I don't know much about Websphere, but for Spring you would need to
> configure the transaction handling in your application context. The easiest
> way, which requires no Java code changes, is through declarative
> transactions:
>
>
> http://static.springframework.org/spring/docs/1.2.x/reference/transaction.html#d0e5690
>
> The various txn options are defined here:
>
>
> http://static.springframework.org/spring/docs/2.0-m3/api/org/springframework/transaction/TransactionDefinition.html
>
> The basic idea is that you wrap your DAO bean with a
> TransactionProxyFactoryBean and configure it to use transactions on the
> methods you want to handle as transactions. Then Spring intercepts calls to
> the DAO and treats them as transactions according to how you've configured
> things.
>
> Cheers,
>
> Chris
>
> -----Original Message-----
> From: Bing Lu [mailto:mfcplus@yahoo.com <mf...@yahoo.com>]
> Sent: Wed 8/2/2006 7:34 AM
> To: user-java@ibatis.apache.org
> Subject: RE: daomanager doesn't rollback transaction?
>
> I'm using oracle9 with ibatis sqlmap 2.1.7 and
> deploying on websphere application server and have the
> transaction set as external and I'm using spring 2.0
> following is my code for the transaction. It's able to
> delete but when an exception is thrown after deletion,
> it doesn't rollback, looking forward to your opinions
>
> thanks
>
> try
> {
> this.daoManager.startTransaction();
> this.myDao.updateParent(p);
> this.myDao.deleteChildren(p.getSeqNum());
>
> if(p.getChildren() != null && p.getChildren().size()
> >0)
> {
> for (Iterator it=p.getChildren().iterator();
> it.hasNext(); )
> {
> Child child= (Child)it.next();
> child.setParentSeqNum( p.getSeqNum());
> this.myDao.insertChild(child);
> }
> }
> this.daoManager.commitTransaction();
> }
> finally
> {
> this.daoManager.endTransaction();
> }
>
> --- Chris Lamey <cl...@localmatters.com> wrote:
>
> > Hello,
> >
> > In general, at a very high level, it is safe to say
> > that transactions in iBATIS work. Lots of people
> > are using them regularly without any problems with
> > the right RDBMS configured correctly. For example,
> > my group successfully uses iBATIS 2.1.7 with
> > Postgres 8.x and Spring's declarative transaction
> > manager.
> >
> > However, it's hard to say whether or not anyone's
> > had the issue you're seeing when there isn't much
> > background information on your problem. From what
> > I've seen on this list, people generally get help if
> > they send along this information along with their
> > issue:
> >
> > - Vendor and version of RDBMS (Postgres 8.0, Oracle
> > 10g, etc)
> > - Version of iBATIS DataMapper and/or DAOs
> > - Version of Java
> > - Operation system type and version of the RDBMS and
> > application
> > - Deployment environment (standalone main
> > application, Tomcat, JBoss, Webshere, BEA, etc)
> > - (If applicable) Version of Abator
> > - (If applicable) Version of Spring
> > - Snippet of your sqlmap config file, specifically
> > the settings and, if applicable, transactionManager
> > elements
> > - A write up of expection for transaction
> > management, specifically if you're expecting iBATIS
> > to do it or an external manager. If it's an
> > external manager, what is it and how is it
> > configured.
> >
> > Thanks,
> > Chris
> >
> > -----Original Message-----
> > From: Bing Lu [mailto:mfcplus@yahoo.com <mf...@yahoo.com>]
> > Sent: Tue 8/1/2006 8:56 PM
> > To: user-java@ibatis.apache.org
> > Subject: Re: daomanager doesn't rollback
> > transaction?
> >
> > anybody? no one had this issue before? or what am i
> > doing wrong?
> >
> > --- Bing Lu <mf...@yahoo.com> wrote:
> >
> > > Hi, I'm using daomanager transactions. what I did
> > > was
> > > start a transaction, do couple inserts and a
> > delete
> > > and some more inserts, the problem I have is after
> > > deletion, my insert threw an exception and didn't
> > > finish inserting all the stuff, at this point the
> > > daomanager should rollback to earlier stage(prior
> > to
> > > delete) but when I checked the database, I see the
> > > rows have already been deleted which means the
> > > transaction didn't rollback. Am I doing something
> > > wrong?
> > >
> > > thanks
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam? Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
RE: daomanager doesn't rollback transaction?
Posted by Bing Lu <mf...@yahoo.com>.
ah, so if I were to use the daomanager transactions,
what type of transaction I should be setting? JDBC?
i'll look into the spring intercepting transactions as
well thanks a bunch
--- Chris Lamey <cl...@localmatters.com> wrote:
> If you have an external transaction manager set up,
> the *Transaction calls are effectively ignored
> because you've told iBATIS to leave things up to the
> external manager.
>
> Are you intending to use Websphere as the external
> manager or Spring?
>
> I don't know much about Websphere, but for Spring
> you would need to configure the transaction handling
> in your application context. The easiest way, which
> requires no Java code changes, is through
> declarative transactions:
>
>
>
http://static.springframework.org/spring/docs/1.2.x/reference/transaction.html#d0e5690
>
> The various txn options are defined here:
>
>
>
http://static.springframework.org/spring/docs/2.0-m3/api/org/springframework/transaction/TransactionDefinition.html
>
> The basic idea is that you wrap your DAO bean with
> a TransactionProxyFactoryBean and configure it to
> use transactions on the methods you want to handle
> as transactions. Then Spring intercepts calls to
> the DAO and treats them as transactions according to
> how you've configured things.
>
> Cheers,
> Chris
>
> -----Original Message-----
> From: Bing Lu [mailto:mfcplus@yahoo.com]
> Sent: Wed 8/2/2006 7:34 AM
> To: user-java@ibatis.apache.org
> Subject: RE: daomanager doesn't rollback
> transaction?
>
> I'm using oracle9 with ibatis sqlmap 2.1.7 and
> deploying on websphere application server and have
> the
> transaction set as external and I'm using spring 2.0
> following is my code for the transaction. It's able
> to
> delete but when an exception is thrown after
> deletion,
> it doesn't rollback, looking forward to your
> opinions
>
> thanks
>
> try
> {
> this.daoManager.startTransaction();
> this.myDao.updateParent(p);
> this.myDao.deleteChildren(p.getSeqNum());
>
> if(p.getChildren() != null && p.getChildren().size()
> >0)
> {
> for (Iterator it=p.getChildren().iterator();
> it.hasNext(); )
> {
> Child child= (Child)it.next();
> child.setParentSeqNum( p.getSeqNum());
> this.myDao.insertChild(child);
> }
> }
> this.daoManager.commitTransaction();
> }
> finally
> {
> this.daoManager.endTransaction();
> }
>
> --- Chris Lamey <cl...@localmatters.com> wrote:
>
> > Hello,
> >
> > In general, at a very high level, it is safe to
> say
> > that transactions in iBATIS work. Lots of people
> > are using them regularly without any problems with
> > the right RDBMS configured correctly. For
> example,
> > my group successfully uses iBATIS 2.1.7 with
> > Postgres 8.x and Spring's declarative transaction
> > manager.
> >
> > However, it's hard to say whether or not anyone's
> > had the issue you're seeing when there isn't much
> > background information on your problem. From what
> > I've seen on this list, people generally get help
> if
> > they send along this information along with their
> > issue:
> >
> > - Vendor and version of RDBMS (Postgres 8.0,
> Oracle
> > 10g, etc)
> > - Version of iBATIS DataMapper and/or DAOs
> > - Version of Java
> > - Operation system type and version of the RDBMS
> and
> > application
> > - Deployment environment (standalone main
> > application, Tomcat, JBoss, Webshere, BEA, etc)
> > - (If applicable) Version of Abator
> > - (If applicable) Version of Spring
> > - Snippet of your sqlmap config file, specifically
> > the settings and, if applicable,
> transactionManager
> > elements
> > - A write up of expection for transaction
> > management, specifically if you're expecting
> iBATIS
> > to do it or an external manager. If it's an
> > external manager, what is it and how is it
> > configured.
> >
> > Thanks,
> > Chris
> >
> > -----Original Message-----
> > From: Bing Lu [mailto:mfcplus@yahoo.com]
> > Sent: Tue 8/1/2006 8:56 PM
> > To: user-java@ibatis.apache.org
> > Subject: Re: daomanager doesn't rollback
> > transaction?
> >
> > anybody? no one had this issue before? or what am
> i
> > doing wrong?
> >
> > --- Bing Lu <mf...@yahoo.com> wrote:
> >
> > > Hi, I'm using daomanager transactions. what I
> did
> > > was
> > > start a transaction, do couple inserts and a
> > delete
> > > and some more inserts, the problem I have is
> after
> > > deletion, my insert threw an exception and
> didn't
> > > finish inserting all the stuff, at this point
> the
> > > daomanager should rollback to earlier
> stage(prior
> > to
> > > delete) but when I checked the database, I see
> the
> > > rows have already been deleted which means the
> > > transaction didn't rollback. Am I doing
> something
> > > wrong?
> > >
> > > thanks
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam? Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
RE: daomanager doesn't rollback transaction?
Posted by Chris Lamey <cl...@localmatters.com>.
If you have an external transaction manager set up, the *Transaction calls are effectively ignored because you've told iBATIS to leave things up to the external manager.
Are you intending to use Websphere as the external manager or Spring?
I don't know much about Websphere, but for Spring you would need to configure the transaction handling in your application context. The easiest way, which requires no Java code changes, is through declarative transactions:
http://static.springframework.org/spring/docs/1.2.x/reference/transaction.html#d0e5690
The various txn options are defined here:
http://static.springframework.org/spring/docs/2.0-m3/api/org/springframework/transaction/TransactionDefinition.html
The basic idea is that you wrap your DAO bean with a TransactionProxyFactoryBean and configure it to use transactions on the methods you want to handle as transactions. Then Spring intercepts calls to the DAO and treats them as transactions according to how you've configured things.
Cheers,
Chris
-----Original Message-----
From: Bing Lu [mailto:mfcplus@yahoo.com]
Sent: Wed 8/2/2006 7:34 AM
To: user-java@ibatis.apache.org
Subject: RE: daomanager doesn't rollback transaction?
I'm using oracle9 with ibatis sqlmap 2.1.7 and
deploying on websphere application server and have the
transaction set as external and I'm using spring 2.0
following is my code for the transaction. It's able to
delete but when an exception is thrown after deletion,
it doesn't rollback, looking forward to your opinions
thanks
try
{
this.daoManager.startTransaction();
this.myDao.updateParent(p);
this.myDao.deleteChildren(p.getSeqNum());
if(p.getChildren() != null && p.getChildren().size()
>0)
{
for (Iterator it=p.getChildren().iterator();
it.hasNext(); )
{
Child child= (Child)it.next();
child.setParentSeqNum( p.getSeqNum());
this.myDao.insertChild(child);
}
}
this.daoManager.commitTransaction();
}
finally
{
this.daoManager.endTransaction();
}
--- Chris Lamey <cl...@localmatters.com> wrote:
> Hello,
>
> In general, at a very high level, it is safe to say
> that transactions in iBATIS work. Lots of people
> are using them regularly without any problems with
> the right RDBMS configured correctly. For example,
> my group successfully uses iBATIS 2.1.7 with
> Postgres 8.x and Spring's declarative transaction
> manager.
>
> However, it's hard to say whether or not anyone's
> had the issue you're seeing when there isn't much
> background information on your problem. From what
> I've seen on this list, people generally get help if
> they send along this information along with their
> issue:
>
> - Vendor and version of RDBMS (Postgres 8.0, Oracle
> 10g, etc)
> - Version of iBATIS DataMapper and/or DAOs
> - Version of Java
> - Operation system type and version of the RDBMS and
> application
> - Deployment environment (standalone main
> application, Tomcat, JBoss, Webshere, BEA, etc)
> - (If applicable) Version of Abator
> - (If applicable) Version of Spring
> - Snippet of your sqlmap config file, specifically
> the settings and, if applicable, transactionManager
> elements
> - A write up of expection for transaction
> management, specifically if you're expecting iBATIS
> to do it or an external manager. If it's an
> external manager, what is it and how is it
> configured.
>
> Thanks,
> Chris
>
> -----Original Message-----
> From: Bing Lu [mailto:mfcplus@yahoo.com]
> Sent: Tue 8/1/2006 8:56 PM
> To: user-java@ibatis.apache.org
> Subject: Re: daomanager doesn't rollback
> transaction?
>
> anybody? no one had this issue before? or what am i
> doing wrong?
>
> --- Bing Lu <mf...@yahoo.com> wrote:
>
> > Hi, I'm using daomanager transactions. what I did
> > was
> > start a transaction, do couple inserts and a
> delete
> > and some more inserts, the problem I have is after
> > deletion, my insert threw an exception and didn't
> > finish inserting all the stuff, at this point the
> > daomanager should rollback to earlier stage(prior
> to
> > delete) but when I checked the database, I see the
> > rows have already been deleted which means the
> > transaction didn't rollback. Am I doing something
> > wrong?
> >
> > thanks
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
RE: daomanager doesn't rollback transaction?
Posted by Bing Lu <mf...@yahoo.com>.
I'm using oracle9 with ibatis sqlmap 2.1.7 and
deploying on websphere application server and have the
transaction set as external and I'm using spring 2.0
following is my code for the transaction. It's able to
delete but when an exception is thrown after deletion,
it doesn't rollback, looking forward to your opinions
thanks
try
{
this.daoManager.startTransaction();
this.myDao.updateParent(p);
this.myDao.deleteChildren(p.getSeqNum());
if(p.getChildren() != null && p.getChildren().size()
>0)
{
for (Iterator it=p.getChildren().iterator();
it.hasNext(); )
{
Child child= (Child)it.next();
child.setParentSeqNum( p.getSeqNum());
this.myDao.insertChild(child);
}
}
this.daoManager.commitTransaction();
}
finally
{
this.daoManager.endTransaction();
}
--- Chris Lamey <cl...@localmatters.com> wrote:
> Hello,
>
> In general, at a very high level, it is safe to say
> that transactions in iBATIS work. Lots of people
> are using them regularly without any problems with
> the right RDBMS configured correctly. For example,
> my group successfully uses iBATIS 2.1.7 with
> Postgres 8.x and Spring's declarative transaction
> manager.
>
> However, it's hard to say whether or not anyone's
> had the issue you're seeing when there isn't much
> background information on your problem. From what
> I've seen on this list, people generally get help if
> they send along this information along with their
> issue:
>
> - Vendor and version of RDBMS (Postgres 8.0, Oracle
> 10g, etc)
> - Version of iBATIS DataMapper and/or DAOs
> - Version of Java
> - Operation system type and version of the RDBMS and
> application
> - Deployment environment (standalone main
> application, Tomcat, JBoss, Webshere, BEA, etc)
> - (If applicable) Version of Abator
> - (If applicable) Version of Spring
> - Snippet of your sqlmap config file, specifically
> the settings and, if applicable, transactionManager
> elements
> - A write up of expection for transaction
> management, specifically if you're expecting iBATIS
> to do it or an external manager. If it's an
> external manager, what is it and how is it
> configured.
>
> Thanks,
> Chris
>
> -----Original Message-----
> From: Bing Lu [mailto:mfcplus@yahoo.com]
> Sent: Tue 8/1/2006 8:56 PM
> To: user-java@ibatis.apache.org
> Subject: Re: daomanager doesn't rollback
> transaction?
>
> anybody? no one had this issue before? or what am i
> doing wrong?
>
> --- Bing Lu <mf...@yahoo.com> wrote:
>
> > Hi, I'm using daomanager transactions. what I did
> > was
> > start a transaction, do couple inserts and a
> delete
> > and some more inserts, the problem I have is after
> > deletion, my insert threw an exception and didn't
> > finish inserting all the stuff, at this point the
> > daomanager should rollback to earlier stage(prior
> to
> > delete) but when I checked the database, I see the
> > rows have already been deleted which means the
> > transaction didn't rollback. Am I doing something
> > wrong?
> >
> > thanks
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
RE: daomanager doesn't rollback transaction?
Posted by Chris Lamey <cl...@localmatters.com>.
Hello,
In general, at a very high level, it is safe to say that transactions in iBATIS work. Lots of people are using them regularly without any problems with the right RDBMS configured correctly. For example, my group successfully uses iBATIS 2.1.7 with Postgres 8.x and Spring's declarative transaction manager.
However, it's hard to say whether or not anyone's had the issue you're seeing when there isn't much background information on your problem. >From what I've seen on this list, people generally get help if they send along this information along with their issue:
- Vendor and version of RDBMS (Postgres 8.0, Oracle 10g, etc)
- Version of iBATIS DataMapper and/or DAOs
- Version of Java
- Operation system type and version of the RDBMS and application
- Deployment environment (standalone main application, Tomcat, JBoss, Webshere, BEA, etc)
- (If applicable) Version of Abator
- (If applicable) Version of Spring
- Snippet of your sqlmap config file, specifically the settings and, if applicable, transactionManager elements
- A write up of expection for transaction management, specifically if you're expecting iBATIS to do it or an external manager. If it's an external manager, what is it and how is it configured.
Thanks,
Chris
-----Original Message-----
From: Bing Lu [mailto:mfcplus@yahoo.com]
Sent: Tue 8/1/2006 8:56 PM
To: user-java@ibatis.apache.org
Subject: Re: daomanager doesn't rollback transaction?
anybody? no one had this issue before? or what am i
doing wrong?
--- Bing Lu <mf...@yahoo.com> wrote:
> Hi, I'm using daomanager transactions. what I did
> was
> start a transaction, do couple inserts and a delete
> and some more inserts, the problem I have is after
> deletion, my insert threw an exception and didn't
> finish inserting all the stuff, at this point the
> daomanager should rollback to earlier stage(prior to
> delete) but when I checked the database, I see the
> rows have already been deleted which means the
> transaction didn't rollback. Am I doing something
> wrong?
>
> thanks
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: daomanager doesn't rollback transaction?
Posted by Bing Lu <mf...@yahoo.com>.
anybody? no one had this issue before? or what am i
doing wrong?
--- Bing Lu <mf...@yahoo.com> wrote:
> Hi, I'm using daomanager transactions. what I did
> was
> start a transaction, do couple inserts and a delete
> and some more inserts, the problem I have is after
> deletion, my insert threw an exception and didn't
> finish inserting all the stuff, at this point the
> daomanager should rollback to earlier stage(prior to
> delete) but when I checked the database, I see the
> rows have already been deleted which means the
> transaction didn't rollback. Am I doing something
> wrong?
>
> thanks
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com