The situation is worse, when I try to output a sub view:

            component Table, {...@elements: PageHelper.GetRandom(max,
viewData.RelatedThemes), @numberCols: 5, @cssClass: "articlesTable",
@caption: "Temas de Festa relacionados a ${viewData.Title}"}:
                section item:
                    OutputSubView("/Shared/ModelTile", {...@model: item})
                end
            end

I have no hook there to define the rendering and therefore the output
textwriter is ignored and as a consequence the subview renders before the
table component. Is this Brail specific, maybe?

--Jan

On Wed, Apr 7, 2010 at 6:29 PM, Christian Wuerdig <[email protected]> wrote:

>  Mh, I haven't tried it but one thing is probably wrong: OnDispose.Commit
> So Save() throws an exception which causes it to leave the using block and
> in turn tries to commit the transaction with an invalid object. That doesn't
> seem right. You should use OnDispose.Rollback and explicitly commit at the
> end when all actions where successful.
>
>
> Morten Brix Pedersen wrote:
>
> I'm having an issue where my transactions are not being properly
> rolled back when an exception occurs. I would really appreciate any
> insight to this problem.
>
> My entity is defined as follows:
>
>       [ActiveRecord]
>       public class Dog : ActiveRecordLinqBase<Dog>
>       {
>               [PrimaryKey]
>               public Guid Id
>               {
>                       get;
>                       set;
>               }
>
>               [Property(Length = 5)]
>               public string Name
>               {
>                       get;
>                       set;
>               }
>       }
>
> The following code correctly throws an exception when I insert a dog
> with a name that is too long. However, future queries on the entity
> gives me an exception. Note that if I change the primary key to be of
> integer type instead of Guid, it works!
>
>               using (new SessionScope())
>               {
>                       try
>                       {
>                               using (new TransactionScope(TransactionMode.New,
> OnDispose.Commit))
>                               {
>                                       var dog = new Dog
>                                       {
>                                               Name = "TooLongNameForADog"
>                                       };
>                                       dog.Save();
>                               }
>
>                       }
>                       catch (Exception ex)
>                       {
>                               // Exception occurs: "An error occured when 
> trying to dispose the
> transaction: Could not insert [...]"
>                               var dogFromDatabase = Dog.FindFirst();
>                               // A new exception gets thrown: "Could not 
> perform SlicedFindAll
> for Dog: "could not insert [...]"
>                       }
>               }
>
> Thanks.
>
>
>
>
>
>   --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To post to this group, send email to [email protected]
> .
> To unsubscribe from this group, send email to
> [email protected]<castle-project-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
>



-- 
Jan

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to