PostgreSQL and LLBLGenProDataSource2 with LivePersistance=true

Posts   
 
    
yowl
User
Posts: 271
Joined: 11-Feb-2008
# Posted on: 05-Nov-2008 23:24:35   

Postgres DQE 2.6.8.819 ORMSupportClasses v 2.6.8.1013

If there is a problem with the SQL (e.g. a non null property is not populated on a new entity) the data source seems to just swallow the exception? Is there something I need to do to enable the exception to be seen somewhere as its difficult to debug without the exception (I have to switch LivePersistance=false and code the performwork which kind of defeats the point). The trace does not show the exception either:

Method Enter: DataAccessAdapterBase.PersistQueue Persistence action info: Action: Insert. Queue length: 1 Current persisted entity info: Entity: em.EntityClasses.PageEntity. ObjectID: 52bf4d02-a740-434d-8c35-3ed5a2e7b27d PrimaryKey field: Id. Type: System.Int32. Value: <undefined value> Method Enter: DataAccessAdapterBase.ExecuteActionQuery Method Enter: DataAccessAdapterBase.OpenConnection Method Exit: DataAccessAdapterBase.OpenConnection Method Exit: DataAccessAdapterBase.ExecuteActionQuery Method Enter: DataAccessAdapterBase.Rollback Method Enter: DataAccessAdapterBase.Reset Method Exit: DataAccessAdapterBase.Reset Method Exit: DataAccessAdapterBase.Rollback Method Enter: DataAccessAdapterBase.CloseConnection Method Exit: DataAccessAdapterBase.CloseConnection Method Exit: DataAccessAdapterBase.SaveEntity(4)

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Nov-2008 07:23:17   

Could you post some info about the entity you are persisting (the DDL of the table) and some code where you are getting this problem?

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 06-Nov-2008 10:25:33   

The code in the datasourcecontrol doesn't swallow any exception, so if an exception should occur, it should bubble upwards to the control bound to the datasourcecontrol, e.g. the grid (as that control is calling the datasourcecontrol's ExecuteInsert/Update/Delete methods).

Likely the grid you're using has an event which is raised when an exception occurs (devexpress' grid does, for example). If the bound grid swallows the exception, there's little we can do about it.

Frans Bouma | Lead developer LLBLGen Pro
yowl
User
Posts: 271
Joined: 11-Feb-2008
# Posted on: 06-Nov-2008 22:37:03   

Hmmm, I am using the asp GridView:

       <asp:GridView ID="GridView1" runat="server" 
            AllowPaging="True" 
            AutoGenerateColumns="False" 
            CssClass="gridview"
            AlternatingRowStyle-CssClass="even"
            GridLines="None"
            DataKeyNames="Id"
            DataSourceID="gridDataSource" Width="328px" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            onrowcommand="GridView1_RowCommand" >
            <Columns>
                <asp:CommandField ShowSelectButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="Id" ReadOnly="True" SortExpression="Id" />
                <asp:BoundField DataField="LessonId" HeaderText="LessonId" 
                    SortExpression="LessonId" />
                <asp:BoundField DataField="Order" HeaderText="Order" 
                    SortExpression="Order" />
                <asp:TemplateField HeaderText="Questions..." ShowHeader="False">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "MaintainQuestions.aspx?PageId=" + Eval("Id") %>'
                                Text="Edit Questions" ToolTip="Edit Questions"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Order" ShowHeader="False">
                    <ItemTemplate>
                        <asp:Button ID="btnMoveUp" runat="server" Text="Move Up" 
                            CommandName="MoveUp" CommandArgument='<%# Eval("Id") %>' /> 
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <AlternatingRowStyle CssClass="even" />
        </asp:GridView>

and the datasource:

<llblgenpro:LLBLGenProDataSource2 ID="detailsDataSource" runat="server" 
    AdapterTypeName="em.DatabaseSpecific.DataAccessAdapter, emDBSpecific" 
    DataContainerType="EntityCollection" 
    EntityFactoryTypeName="em.FactoryClasses.PageEntityFactory, em" 
    onentityinserted="detailsDataSource_EntityInserted" 
    onentityinserting="detailsDataSource_EntityInserting" 
    ThrowExceptionOnIllegalFieldInput="True">
</llblgenpro:LLBLGenProDataSource2>

The Order field is the non nullable field in question. I cant see any events on the grid control which would fire in the case of an exception, and in any case I dont see why the grid would swallow when LivePersistance=true, and not swallow when LivePersistance=false - how would the grid know?

Table schema:

CREATE TABLE page ( id serial NOT NULL, lesson_id integer NOT NULL, "order" integer NOT NULL, page_text character varying(100), CONSTRAINT page_pk PRIMARY KEY (id), CONSTRAINT page_lesson FOREIGN KEY (lesson_id) REFERENCES lesson ("Id") MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ) WITH (OIDS=FALSE);

yowl
User
Posts: 271
Joined: 11-Feb-2008
# Posted on: 06-Nov-2008 22:40:33   

Sorry, I take that back, the gridview does still swallow the exception when LivePersistance=false.

yowl
User
Posts: 271
Joined: 11-Feb-2008
# Posted on: 06-Nov-2008 22:40:33   

Sorry, I take that back, the gridview does still swallow the exception when LivePersistance=false.