SaveEntity not returning true for refetchAfterSave

Posts   
 
    
Kew
User
Posts: 2
Joined: 25-Aug-2009
# Posted on: 25-Aug-2009 19:45:44   

i am using llblgen trial version 2.5 on Oracle 10g XE with .NET windows application. I am trying to get the primary key value saved to the database with my parent table so that i could update the child tables with the parent key. When i try to do RefetchafterSave to update the parent table after Save, it always returns false. Could you please tell us how we can get the saved primary key value of the parent table? THE PRIMARY KEY OF THE PARENT TABLE IS GENERATED AS A SEQUENCE NUMBER IN THE ORACLE DATABASE.

Code tried: DataAccessAdapter adapter = new DataAccessAdapter(true);

    bool bResult = adapter.SaveEntity(caseEntiry, true);

    //bResult = adapter.FetchEntity(backup);

    adapter.CloseConnection();
MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 25-Aug-2009 20:54:02   

You shouldn't need to - as you have the refetch parameter set to true on this line

 bool bResult = adapter.SaveEntity(caseEntiry, true);

after the save the primary key value of the entity should contain the new value.

Kew
User
Posts: 2
Joined: 25-Aug-2009
# Posted on: 27-Aug-2009 03:16:10   

This actually didn't work

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Aug-2009 06:13:00   

Please give us more info (http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7720). In special: - LLBLGen build and runtime library version (see above link) - Did you set that Sequence for the entity on LLBLGen Designer? It isn't trigger-based right? - What is the Generated Sql for the save?

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 27-Aug-2009 11:30:02   

I am using llblgen trial version 2.5

I find that hard to believe, as that trial hasn't been available since june 2008. Or you use a cracked version, or you made a typo. Please state proper information like build nr of the designer.

Frans Bouma | Lead developer LLBLGen Pro