[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

How to flush all tables

Luegisdorf

1/17/2006 12:36:00 PM

Hi everyone

I need a command which flushs all tables instead of flushing one specified
table. Until yet I didn't find something like this, but may be you know it!

The situation is that I use dynamicly created buffers (common = new
DictTable(anyNo).makeRecord()) and sometimes an error throws, after I catch
with try/catch I want restart - but of course with a flushed DB memory ...

Thank you for answers.
Best regards
Patrick
7 Answers

hghrp

1/17/2006 12:51:00 PM

0

Hi Patrick,

and ttsbegin/ttsabort does not do the trick?

regards,
harald

"Luegisdorf" wrote:

> Hi everyone
>
> I need a command which flushs all tables instead of flushing one specified
> table. Until yet I didn't find something like this, but may be you know it!
>
> The situation is that I use dynamicly created buffers (common = new
> DictTable(anyNo).makeRecord()) and sometimes an error throws, after I catch
> with try/catch I want restart - but of course with a flushed DB memory ...
>
> Thank you for answers.
> Best regards
> Patrick

Luegisdorf

1/17/2006 1:01:00 PM

0

Hi hghrp

of course my code is inside a tts but if a error occoured the cache is not
flushed for the class which was proceed the code and tried to rerun. If I
close the the process and start the class again, the data looks flushed.

.......
situaion like:

void doSomething()
{
// data manipulation with dynamic created buffers
}

try
{
ttsbegin;

doSomething();

ttscommit;
}
catch
{
ttsbegin;
doSomething(); // try again, but the cache looks not flushed ...
ttscommit;
}
.......
other ideas?

Thank you
Best regards
Patrick


"hghrp" wrote:

> Hi Patrick,
>
> and ttsbegin/ttsabort does not do the trick?
>
> regards,
> harald
>
> "Luegisdorf" wrote:
>
> > Hi everyone
> >
> > I need a command which flushs all tables instead of flushing one specified
> > table. Until yet I didn't find something like this, but may be you know it!
> >
> > The situation is that I use dynamicly created buffers (common = new
> > DictTable(anyNo).makeRecord()) and sometimes an error throws, after I catch
> > with try/catch I want restart - but of course with a flushed DB memory ...
> >
> > Thank you for answers.
> > Best regards
> > Patrick

hghrp

1/17/2006 1:10:00 PM

0

Hi Patrick,

how about an init method?

you could then call it within the catch

hth,
harald

"Luegisdorf" wrote:

> Hi hghrp
>
> of course my code is inside a tts but if a error occoured the cache is not
> flushed for the class which was proceed the code and tried to rerun. If I
> close the the process and start the class again, the data looks flushed.
>
> ......
> situaion like:
>
> void doSomething()
> {
> // data manipulation with dynamic created buffers
> }
>
> try
> {
> ttsbegin;
>
> doSomething();
>
> ttscommit;
> }
> catch
> {
> ttsbegin;
> doSomething(); // try again, but the cache looks not flushed ...
> ttscommit;
> }
> ......
> other ideas?
>
> Thank you
> Best regards
> Patrick
>
>
> "hghrp" wrote:
>
> > Hi Patrick,
> >
> > and ttsbegin/ttsabort does not do the trick?
> >
> > regards,
> > harald
> >
> > "Luegisdorf" wrote:
> >
> > > Hi everyone
> > >
> > > I need a command which flushs all tables instead of flushing one specified
> > > table. Until yet I didn't find something like this, but may be you know it!
> > >
> > > The situation is that I use dynamicly created buffers (common = new
> > > DictTable(anyNo).makeRecord()) and sometimes an error throws, after I catch
> > > with try/catch I want restart - but of course with a flushed DB memory ...
> > >
> > > Thank you for answers.
> > > Best regards
> > > Patrick

hghrp

1/17/2006 1:21:00 PM

0

what i meant in detail:

void doSomethingInit()
{
// do here what cannot fail, e.g. filling the buffers
}
void doSomething()
{
// here you do what may fail e.g. saving the records
}
....
try {
ttsbegin;
doSomethingInit();
doSomething();
ttscommit;
}
catch {
ttsbegin;
doSomething(); //now buffers are filled with the values you want
ttscommit;
}

regards,
harald

"hghrp" wrote:

> Hi Patrick,
>
> how about an init method?
>
> you could then call it within the catch
>
> hth,
> harald
>
> "Luegisdorf" wrote:
>
> > Hi hghrp
> >
> > of course my code is inside a tts but if a error occoured the cache is not
> > flushed for the class which was proceed the code and tried to rerun. If I
> > close the the process and start the class again, the data looks flushed.
> >
> > ......
> > situaion like:
> >
> > void doSomething()
> > {
> > // data manipulation with dynamic created buffers
> > }
> >
> > try
> > {
> > ttsbegin;
> >
> > doSomething();
> >
> > ttscommit;
> > }
> > catch
> > {
> > ttsbegin;
> > doSomething(); // try again, but the cache looks not flushed ...
> > ttscommit;
> > }
> > ......
> > other ideas?
> >
> > Thank you
> > Best regards
> > Patrick
> >
> >
> > "hghrp" wrote:
> >
> > > Hi Patrick,
> > >
> > > and ttsbegin/ttsabort does not do the trick?
> > >
> > > regards,
> > > harald
> > >
> > > "Luegisdorf" wrote:
> > >
> > > > Hi everyone
> > > >
> > > > I need a command which flushs all tables instead of flushing one specified
> > > > table. Until yet I didn't find something like this, but may be you know it!
> > > >
> > > > The situation is that I use dynamicly created buffers (common = new
> > > > DictTable(anyNo).makeRecord()) and sometimes an error throws, after I catch
> > > > with try/catch I want restart - but of course with a flushed DB memory ...
> > > >
> > > > Thank you for answers.
> > > > Best regards
> > > > Patrick

Luegisdorf

1/17/2006 1:36:00 PM

0

Thanks for answer

the problem is that I cannot declare the buffers global because I don't know
which buffers are modified and I have to modify data before and after the
section where an error can occour.

I think I had to execute "flush " trough runBuf as many times I need (with a
loop for all tables I only knowing at runtime).

Thank you anyway!

Best regards
Patrick

"hghrp" wrote:

> what i meant in detail:
>
> void doSomethingInit()
> {
> // do here what cannot fail, e.g. filling the buffers
> }
> void doSomething()
> {
> // here you do what may fail e.g. saving the records
> }
> ...
> try {
> ttsbegin;
> doSomethingInit();
> doSomething();
> ttscommit;
> }
> catch {
> ttsbegin;
> doSomething(); //now buffers are filled with the values you want
> ttscommit;
> }
>
> regards,
> harald
>
> "hghrp" wrote:
>
> > Hi Patrick,
> >
> > how about an init method?
> >
> > you could then call it within the catch
> >
> > hth,
> > harald
> >
> > "Luegisdorf" wrote:
> >
> > > Hi hghrp
> > >
> > > of course my code is inside a tts but if a error occoured the cache is not
> > > flushed for the class which was proceed the code and tried to rerun. If I
> > > close the the process and start the class again, the data looks flushed.
> > >
> > > ......
> > > situaion like:
> > >
> > > void doSomething()
> > > {
> > > // data manipulation with dynamic created buffers
> > > }
> > >
> > > try
> > > {
> > > ttsbegin;
> > >
> > > doSomething();
> > >
> > > ttscommit;
> > > }
> > > catch
> > > {
> > > ttsbegin;
> > > doSomething(); // try again, but the cache looks not flushed ...
> > > ttscommit;
> > > }
> > > ......
> > > other ideas?
> > >
> > > Thank you
> > > Best regards
> > > Patrick
> > >
> > >
> > > "hghrp" wrote:
> > >
> > > > Hi Patrick,
> > > >
> > > > and ttsbegin/ttsabort does not do the trick?
> > > >
> > > > regards,
> > > > harald
> > > >
> > > > "Luegisdorf" wrote:
> > > >
> > > > > Hi everyone
> > > > >
> > > > > I need a command which flushs all tables instead of flushing one specified
> > > > > table. Until yet I didn't find something like this, but may be you know it!
> > > > >
> > > > > The situation is that I use dynamicly created buffers (common = new
> > > > > DictTable(anyNo).makeRecord()) and sometimes an error throws, after I catch
> > > > > with try/catch I want restart - but of course with a flushed DB memory ...
> > > > >
> > > > > Thank you for answers.
> > > > > Best regards
> > > > > Patrick

Micha³ Kupczyk

1/17/2006 2:37:00 PM

0

"Luegisdorf"
> The situation is that I use dynamicly created buffers (common = new
> DictTable(anyNo).makeRecord()) and sometimes an error throws, after I
> catch

Maybe you need to try
common.disableCache(true)

and do not worry about 'flush'?

--
Michal


Luegisdorf

1/17/2006 4:08:00 PM

0

Hi Michal

Oh Dear! Have used a temporary table and forgot to empty them before reuse
... that's the matter why I've got duplicate entries in table!! .. and by
ttsabort a temporary table keep its data ...

Sorry for your efforts - that's was a very nasty bug from me.
Best regards
Patrick


"Michal Kupczyk >" wrote:

> "Luegisdorf"
> > The situation is that I use dynamicly created buffers (common = new
> > DictTable(anyNo).makeRecord()) and sometimes an error throws, after I
> > catch
>
> Maybe you need to try
> common.disableCache(true)
>
> and do not worry about 'flush'?
>
> --
> Michal
>
>
>