Board index » jbuilder » Fun never ends, nature of the beast

Fun never ends, nature of the beast


2006-08-10 03:45:50 AM
jbuilder10
In the same program I use the same table as a work table more than once
(a few times) only this one fails for a reason.
Even after the cancel() and close() it keeps the rows in it.
No clue.
So I rely on the old fashioned way: deleteAllRows() if getRowCount()
first cycle false, true, 0
but the second cycle should be true, false, 0 but it is as follows:
System.out.println(dataSet.isOpen()); ===>true
if (dataSet.isOpen())
{
dataSet.cancel();
dataSet.close();
}
System.out.println(dataSet.isOpen()); ====>false
dataSet.open();
System.out.println(dataSet.getRowCount()); ====>2
 
 

Re:Fun never ends, nature of the beast

previuos results should be false, false, 0
true, false, 2 (which should be 0
after a close/open)
JBuilderX\jdk1.4\jre\lib\plugin.jar;C:\JBuilderX\jdk1.4\jre\lib\rt.jar;.......
-Xms256M -Xmx256M mbl.Application1
false
false
0
onePurchaseOrderEstimateDataSet: 0
TrueType font directory does not exist: c:/winnt/fonts
true
false
2
onePurchaseOrderEstimateDataSet: 2
 

Re:Fun never ends, nature of the beast

It is kind of hard to tell specifically what you are doing and you may
be leaving out critical information.. But..
dataset.cancel() only cancels edits to a new or existing record. (see
documentation) So if you are putting in multiple rows the cancel will
only work on the LAST row entered.
If you have multiple rows, you would then need to deleteAllRows();
Are you using a TableDataSet or a QueryDataSet for this..???
Mehmet F. Erten wrote:
Quote
In the same program I use the same table as a work table more than once
(a few times) only this one fails for a reason.

Even after the cancel() and close() it keeps the rows in it.
No clue.
So I rely on the old fashioned way: deleteAllRows() if getRowCount()

first cycle false, true, 0
but the second cycle should be true, false, 0 but it is as follows:

System.out.println(dataSet.isOpen()); ===>true
if (dataSet.isOpen())
{
dataSet.cancel();
dataSet.close();
}
System.out.println(dataSet.isOpen()); ====>false
dataSet.open();
System.out.println(dataSet.getRowCount()); ====>2


--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/paperFAQ.html
====================================================
 

{smallsort}

Re:Fun never ends, nature of the beast

Hi,
I use QueryDataSet.
This was working OK with JDataStore.
And it works with InterBase in many other codes I have.
In this occation closing and opening again does not get rid of the rows. But
I also do not get any Exception (if any reason these rows or this table are
locked.
So I check row count and delete them all if there is any.
I am reading the table columns without any condition and since there is no
data, it should be empty all the time when I open or refresh it.
In this case, it is not, does not matter if refreshed or closed/opened the
previous rows stays.
 

Re:Fun never ends, nature of the beast

Mehmet F. Erten wrote:
Quote
Hi,
I use QueryDataSet.
This was working OK with JDataStore.
And it works with InterBase in many other codes I have.
In this occation closing and opening again does not get rid of the rows.
It never should drop rows due to closing or opening..
But
Quote
I also do not get any Exception (if any reason these rows or this table are
locked.
That is not applicable to the QueryDataSet.. The QDS is an in memory
table and is not connected to the database.. (Provide/Resolve model) so
locking does not apply.
Quote
So I check row count and delete them all if there is any.
I am reading the table columns without any condition and since there is no
data, it should be empty all the time when I open or refresh it.
In this case, it is not, does not matter if refreshed or closed/opened the
previous rows stays.
It should stay.. (based on what you have said..)
Quote




--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/paperFAQ.html
====================================================
 

Re:Fun never ends, nature of the beast

John,
Don't forget this table usage.
It is a work table, never saved.
It is always empty in the database.
if I close and open it (no where clause) it will bring nothing since there
is no record in it.
Later if I insert some rows, they will be in it until it is refreshed or
closed.
After whenever I open it, it should be again an empty table.
At this time I will stick to the workaround since it is an isoloated
incident (one program) and I won't spend any time to fix it (still I have to
discover a lot about InterBase as scheduled batch Backup: I will post this
in interbase.general)
Thanks for your help.
"John Moore (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote
Mehmet F. Erten wrote:
>Hi,
>I use QueryDataSet.
>This was working OK with JDataStore.
>And it works with InterBase in many other codes I have.
>In this occation closing and opening again does not get rid of the rows.

It never should drop rows due to closing or opening..

But
>I also do not get any Exception (if any reason these rows or this table
>are locked.

That is not applicable to the QueryDataSet.. The QDS is an in memory
table and is not connected to the database.. (Provide/Resolve model) so
locking does not apply.

>So I check row count and delete them all if there is any.
>I am reading the table columns without any condition and since there is
>no data, it should be empty all the time when I open or refresh it.
>In this case, it is not, does not matter if refreshed or closed/opened
>the previous rows stays.

It should stay.. (based on what you have said..)

>
>
>
>


--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/paperFAQ.html
====================================================
 

Re:Fun never ends, nature of the beast

Mehmet F. Erten wrote:
Quote
John,
Don't forget this table usage.
I understand..
Quote
It is a work table, never saved.
That is why I asked if it was a QueryDataSet or a TableDataSet..
In your case you should be using a TableDataSet, you are miss using the
tools.. (Using a hammer to put on masking tape...<G>)
Quote
It is always empty in the database.
Why is that table even there..<G>
Quote
if I close and open it (no where clause) it will bring nothing since there
is no record in it.
Hence the TableDataSet should be used..
For the QueryDataSet you should set to false the "execute on open"
(executeOnOpen) flag of the QueryDescriptor(...)
On the other hand this is what probably makes you think that opening the
QDS is emptying it.. It is in the sense that you are doing a re-query,
but that is a very bad waste of bandwidth to the data server..
Quote
Later if I insert some rows, they will be in it until it is refreshed or
closed.
After whenever I open it, it should be again an empty table.
Only if the executeOnOpen flag is set to true..
Quote
At this time I will stick to the workaround since it is an isoloated
incident (one program) and I won't spend any time to fix it (still I have to
discover a lot about InterBase as scheduled batch Backup: I will post this
in interbase.general)
As I said before I still think you should be using the TableDataSet for
this task..
Quote
Thanks for your help.

"John Moore (TeamB)" < XXXX@XXXXX.COM >wrote in message
news:44dccc95$ XXXX@XXXXX.COM ...
>Mehmet F. Erten wrote:
>>Hi,
>>I use QueryDataSet.
>>This was working OK with JDataStore.
>>And it works with InterBase in many other codes I have.
>>In this occation closing and opening again does not get rid of the rows.
>It never should drop rows due to closing or opening..
>
>But
>>I also do not get any Exception (if any reason these rows or this table
>>are locked.
>That is not applicable to the QueryDataSet.. The QDS is an in memory
>table and is not connected to the database.. (Provide/Resolve model) so
>locking does not apply.
>
>>So I check row count and delete them all if there is any.
>>I am reading the table columns without any condition and since there is
>>no data, it should be empty all the time when I open or refresh it.
>>In this case, it is not, does not matter if refreshed or closed/opened
>>the previous rows stays.
>It should stay.. (based on what you have said..)
>
>>
>>
>>
>
>--
>=============================================
>TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
>Post all questions and replies to this newsgroup ONLY
>For papers on DataExpress, Applets, JSP, and Web Development go to:
>www.microps.com/mps/paperFAQ.html
>====================================================


--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/paperFAQ.html
====================================================
 

Re:Fun never ends, nature of the beast

Hi Mehmet,
As I read the thread it seems you dont't want to persist any changes to the
underlying db-table. Therefore, as John mentioned, you should use an plain
in-memory table to do the job. To me it looks not like a db problem, it's a
problem of data persistence, so strictly cache all changes on the client and
discard everything when done. So you possibly only need underlying metadata
from your db to create an in-memory worktable.
In case you work in a kind of briefcase model you automatically encounter
the expected behaving, as soon as you leave this model it seems to behave
unexpected since all changes are comited automatically by default.
Regards
Max
"Mehmet F. Erten" < XXXX@XXXXX.COM >wrote in message
Quote
John,
Don't forget this table usage.
It is a work table, never saved.
It is always empty in the database.
if I close and open it (no where clause) it will bring nothing since there
is no record in it.
Later if I insert some rows, they will be in it until it is refreshed or
closed.
After whenever I open it, it should be again an empty table.
At this time I will stick to the workaround since it is an isoloated
incident (one program) and I won't spend any time to fix it (still I have
to
discover a lot about InterBase as scheduled batch Backup: I will post this
in interbase.general)
Thanks for your help.

"John Moore (TeamB)" < XXXX@XXXXX.COM >wrote in message
news:44dccc95$ XXXX@XXXXX.COM ...
>Mehmet F. Erten wrote:
>>Hi,
>>I use QueryDataSet.
>>This was working OK with JDataStore.
>>And it works with InterBase in many other codes I have.
>>In this occation closing and opening again does not get rid of the
rows.
>
>It never should drop rows due to closing or opening..
>
>But
>>I also do not get any Exception (if any reason these rows or this table
>>are locked.
>
>That is not applicable to the QueryDataSet.. The QDS is an in memory
>table and is not connected to the database.. (Provide/Resolve model) so
>locking does not apply.
>
>>So I check row count and delete them all if there is any.
>>I am reading the table columns without any condition and since there is
>>no data, it should be empty all the time when I open or refresh it.
>>In this case, it is not, does not matter if refreshed or closed/opened
>>the previous rows stays.
>
>It should stay.. (based on what you have said..)
>
>>
>>
>>
>>
>
>
>--
>=============================================
>TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
>Post all questions and replies to this newsgroup ONLY
>For papers on DataExpress, Applets, JSP, and Web Development go to:
>www.microps.com/mps/paperFAQ.html
>====================================================