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 Paul Benedict <pa...@yahoo.com> on 2005/10/29 19:08:06 UTC

Can I turn transactions off? Help!

I am a HUGE fan of IBATIS, but suddenly I find myself
in a really bad situation which might force me to dump
it. I am using the Spring Framework to do CMT for me
and I want that to handle my transactions for me --
and this is how I was expecting it, but then I did a
little test:

I threw a NullPointerException after I called insert
after iBATIS and, to my surprise after 2 days of
debugging and stepping through iBATIS code, it's still
committing my transaction! I was expecting Spring to
catch the exception and roll back (which it did), but
I couldn't figure out how it was still comitting. But
then I stepped into iBATIS and saw it's ALWAYS is
commiting. This is unacceptable.

How do I turn off iBATIS from ever committing after an
insert, update, or delete? I do NOT want this to be
handled for me.

Thanks!
Paul


		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

Re: Collection properties in resultMap

Posted by Clinton Begin <cl...@gmail.com>.
It should be possible, but I can't even remember. More importantly, why
would you do that?

If your set is fixed enough to be enumerated to customField1...customField3,
then why wouldn't you just have 3 properties on your class called
CustomField1 ... CustomField3?

You're creating potential for pain in the future with a design like that.

Cheers,
Clinton


On 10/29/05, Amad Fida <am...@gmail.com> wrote:
>
> Hi all,
>
> I have a table which has columns like CutomField1, CustomField2, etc
>
> Now I have a class
>
> Class User {
>
> private Collection customFields;
> .....
> }
>
> How would I map individual columns to single collection property?
>
> Is something like this possible?
>
> <resultMap id="user" class="User">
> <result property="customFiels[0]" column="CustomField1"/>
> <result property="customFiels[1]" column="CustomField2"/>
> <result property="customFiels[2]" column="CustomField3"/>
>
> ....
>
>
> Thanks
>
> Amad
>
>

Collection properties in resultMap

Posted by Amad Fida <am...@gmail.com>.
Hi all, 

I have a table which has columns like CutomField1, CustomField2, etc

Now I have a class

Class User {

	private Collection customFields;
	.....
}

How would I map individual columns to single collection property?

Is something like this possible?

  <resultMap id="user" class="User">
    <result property="customFiels[0]" column="CustomField1"/>
    <result property="customFiels[1]" column="CustomField2"/>
    <result property="customFiels[2]" column="CustomField3"/>

	....


Thanks

Amad