Creating And Dropping Tables Regarding 
Author Message
 Creating And Dropping Tables Regarding

Hi everyone,

Iam writing a database server which creates reports on the fly, database
could (SQL Server/MS Access) and the client is IE5.

I have special report which needs to use a temporary table.

So I currently delete all the current records from the temp table(wipe it
clean), add new records then create the report on the fly send it to the
client.
The problem Iam using facing is, if multiple users ask for the same report,
Iam running into synchronization problems. One client  is deleting records,
other client is trying to read records.

Report contains a lot of records to be displayed.

I have 2 solutions to this problem, I want  you guys to help out -

1. Make this serialized, only one client can generate this report at a time
all the others wait in line.

                or

2. Create a temptable on the fly with a current timestamp as the name, do
the processing and drop the table client leaves.

Is there anything that could be done?

Sorry for crossposting,



Sun, 02 Mar 2003 21:40:53 GMT  
 Creating And Dropping Tables Regarding

hello

i think the second option is better
anyway, dont use timestamp as a name but simply the socket descriptor

1. for unique reasons
2. performance, this method let you to create the temp table before
    the connection made, but the point is without any synchronization
object

 for example:

 lets say you use server with AcceptEx method,
you have currently 10 socket pending on AcceptEx listen socket
(with accept you know the socket descriptor before the connection made)

now, every time you call socket AccceptEx you also create the
temp table with name of socket descritor
when someone connect, he already have the temp table
and so on.

(if you use simple poll of temp tables with counter 1.its static 2.you have
to use synchoronization object to protect your counter)

bye

Quote:

>Hi everyone,

>Iam writing a database server which creates reports on the fly, database
>could (SQL Server/MS Access) and the client is IE5.

>I have special report which needs to use a temporary table.

>So I currently delete all the current records from the temp table(wipe it
>clean), add new records then create the report on the fly send it to the
>client.
>The problem Iam using facing is, if multiple users ask for the same report,
>Iam running into synchronization problems. One client  is deleting records,
>other client is trying to read records.

>Report contains a lot of records to be displayed.

>I have 2 solutions to this problem, I want  you guys to help out -

>1. Make this serialized, only one client can generate this report at a time
>all the others wait in line.

>                or

>2. Create a temptable on the fly with a current timestamp as the name, do
>the processing and drop the table client leaves.

>Is there anything that could be done?

>Sorry for crossposting,



Mon, 03 Mar 2003 03:00:00 GMT  
 Creating And Dropping Tables Regarding
Another possibility would be to tag the rows belonging to a report
request, for example with userid, retrieve only those rows for the
report, and delete them afterwards.

Joe



Quote:

> hello

> i think the second option is better
> anyway, dont use timestamp as a name but simply the socket descriptor

> 1. for unique reasons
> 2. performance, this method let you to create the temp table before
>     the connection made, but the point is without any synchronization
> object

>  for example:

>  lets say you use server with AcceptEx method,
> you have currently 10 socket pending on AcceptEx listen socket
> (with accept you know the socket descriptor before the connection
made)

> now, every time you call socket AccceptEx you also create the
> temp table with name of socket descritor
> when someone connect, he already have the temp table
> and so on.

> (if you use simple poll of temp tables with counter 1.its static
2.you have
> to use synchoronization object to protect your counter)

> bye


> >Hi everyone,

> >Iam writing a database server which creates reports on the fly,
database
> >could (SQL Server/MS Access) and the client is IE5.

> >I have special report which needs to use a temporary table.

> >So I currently delete all the current records from the temp table
(wipe it
> >clean), add new records then create the report on the fly send it to
the
> >client.
> >The problem Iam using facing is, if multiple users ask for the same
report,
> >Iam running into synchronization problems. One client  is deleting
records,
> >other client is trying to read records.

> >Report contains a lot of records to be displayed.

> >I have 2 solutions to this problem, I want  you guys to help out -

> >1. Make this serialized, only one client can generate this report at
a time
> >all the others wait in line.

> >                or

> >2. Create a temptable on the fly with a current timestamp as the
name, do
> >the processing and drop the table client leaves.

> >Is there anything that could be done?

> >Sorry for crossposting,

Sent via Deja.com http://www.deja.com/
Before you buy.


Mon, 03 Mar 2003 03:00:00 GMT  
 Creating And Dropping Tables Regarding

Thanks a lot for your response moti,

The way my database server is designed is that, only when it reaches the
parsing routinue, the server actually knows What report it wants. Since the
same reporting facility will have to service 200 other types of reports , it
will create redundancy in my code to create a temp table for every
connection because lot of those connections might not want the special
report.

You were exactly right, I had some uniqueness problems when I used the time
stamps.
The way I solved the problem was to combine  the following-

 Temp table name= rand()+CurrentMinute+CurrentSecond+CurrentMillisecond

I probably think chances of a conflict is very less.

cheers.
jay.


Quote:
> hello

> i think the second option is better
> anyway, dont use timestamp as a name but simply the socket descriptor

> 1. for unique reasons
> 2. performance, this method let you to create the temp table before
>     the connection made, but the point is without any synchronization
> object

>  for example:

>  lets say you use server with AcceptEx method,
> you have currently 10 socket pending on AcceptEx listen socket
> (with accept you know the socket descriptor before the connection made)

> now, every time you call socket AccceptEx you also create the
> temp table with name of socket descritor
> when someone connect, he already have the temp table
> and so on.

> (if you use simple poll of temp tables with counter 1.its static 2.you
have
> to use synchoronization object to protect your counter)

> bye


> >Hi everyone,

> >Iam writing a database server which creates reports on the fly, database
> >could (SQL Server/MS Access) and the client is IE5.

> >I have special report which needs to use a temporary table.

> >So I currently delete all the current records from the temp table(wipe it
> >clean), add new records then create the report on the fly send it to the
> >client.
> >The problem Iam using facing is, if multiple users ask for the same
report,
> >Iam running into synchronization problems. One client  is deleting
records,
> >other client is trying to read records.

> >Report contains a lot of records to be displayed.

> >I have 2 solutions to this problem, I want  you guys to help out -

> >1. Make this serialized, only one client can generate this report at a
time
> >all the others wait in line.

> >                or

> >2. Create a temptable on the fly with a current timestamp as the name, do
> >the processing and drop the table client leaves.

> >Is there anything that could be done?

> >Sorry for crossposting,



Mon, 03 Mar 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. create and drop tables using vc++ADO

2. Creating a table from VC++ using stored in Access import/export table specification

3. Create table(Not a database table)

4. Create table(Not a database table)

5. ODBC drop table problem

6. drop DAO tables

7. Confused regarding apartments, when COM objects are forced by COM to be created and when shared

8. doubt regarding the destruction of objects we create

9. Creating a table dynamically with c# - using events in that table and re-designing the table based on the events

10. Creating Drop Down Window

11. How to create a drop down menu

12. Need to create a drag and drop bitmap

 

 
Powered by phpBB® Forum Software