473,473 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Architectural, design issue, please

Hi. I have the following problem:

The user has to be able to upload lists of PINS (in an Excel/CSV
format). Upon receiving them, the aspnet app must run many rather
complicated queries using the uploaded PIN list and the 'static' files
already in the database. To simplify my coding life, I have imagined
this solution:

a. each user, on login, is assigned a 'Session ID' number, composed of
the PIN of the user and Seconds(now), assuming that no user will login
that many times at the same time... (I should mayube use some other
scheme here, but this, I think, solves MOST of the concurrency
problems). Since Session("SessionID") might be lost if the server gets
low on resources, I save this number in a file on the disk and re-
populate Session ID if necessary (I will save it in the db on the
server, or maybe in cookies, if I can be sure that cookies will be
allowed by the users).

I now have a big problem - the queries I have to run are 1)
complicated 2) MIGHT involve many records and 3) will work with a
different dataset (different input PIN list) for each user logged in.

b. I order to avoid concurrency problems, on each upload, I insert the
contents of the file uploaded by the user (Excel/CSV) into a TEMP
table named ImportedPINS, together with the SessionID number which
will act as a selector. So if 5 users will be online at the same time,
each uploading, say, a list of 200 PINS, I will have in table
"ImportedPINS" a number of 1000 PINS, in 5 sets of 200 each,
differentiated mainly by the SessionID.
>From now on, I will run all my queries with clauses like "WHERE
SessionID = "...", thus separating the datasets.

Because the 'ImportedPINS' table contains an ID column (identity),
which I would like to reset from time to time, and also I don't want
to let 'ImportedPINS' (and similiar tables) grow to much overtime, I:

c. I clean (i.e. recreate) these TEMP tables on "Application_End" in
Global.ASAX with code like this:

Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)

Dim cnSQL As New SqlConnection
Dim cmd As SqlCommand

Try
Context.Cache.Remove("Templates")
'The session variables simply expire on session end...

'Clean up/recreate the temp tables ImportedFiles, DisplayFiles, etc:
cnSQL = New
SqlConnection(System.Configuration.ConfigurationMa nager.AppSettings("ConnectionString"))
cnSQL.Open()

cmd = New SqlCommand("[CreateTableImportedPins]", cnSQL)
cmd.CommandType = CommandType.StoredProcedure
cmd.ExecuteNonQuery()

Catch ex As Exception

Finally
Try
'Explicitly close - don't wait on garbage collection.
cmd = Nothing
cnSQL.Close()
Catch ex As Exception

End Try
End Try
End Sub

Questions:

1. Is this architecture safe ? Does it make sense ? Is there any
other, more intelligent and hopefully not much more laborious,
solution ?

2. I have a problem - the code above, in Global.ASAX, in
Application_END, NEVER EXECUTES !!!! I wonder what's the problem...
Did I make a mistake ?

Thank you very much.
Alex.

Feb 16 '07 #1
0 906

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: eMKa | last post by:
Hi Code guru's I have created a user control which has access, and thus makes use of a shared singleton class like: Dim MyAppSettings As DLAppSettings = DLAppSettings.GetAppSettings This...
2
by: dee | last post by:
hi, I considering designing a online snipe system. This where i input a price and the application will submit the snipe at the desired time to the site. I have been thinking about the design of...
14
by: John Spiegel | last post by:
Hi all, I'm in the early stages of designing a system that we'll use in-house and am looking for opinions and suggestions for further reading on which directions to take. Background: Though...
3
by: Simon Middlemiss | last post by:
I have a multiline textbox which I would like populated in the following manner. "Line1 Line2 Line3 Line4" etc. I know how to do it in code, but is there a way to do it in the design view?
2
by: Viet | last post by:
I have an architectural issue that I have been working on for quite awhile now and I would like another person's point of view. This issue involves the conversion of a VB6 app to VB.NET. In this...
11
by: stax | last post by:
Hi, Assuming having a method that calls another method which also calls other methods and so on having a long winded tree of methods. What do I do in case it turns out everything has to be...
1
by: Griff | last post by:
Hi I'm not sure of the best way to go about achieving my goal and would appreciate any advice. What I would like to do is to generate a control that can be dropped onto a web page. For...
0
by: Paul Hadfield | last post by:
I'm looking for thoughts on the "correct" design for this problem (DotNet 2.0 - in winforms, but that's not so important). I've got two combo boxes (combo1 and combo2), both are populating via...
8
by: obrianpatrick | last post by:
Hi, I am relatively new to object oriented programming and design. I am developing an application in VS 2005. I am having the following design problem: I have two interfaces X and Y. Y is...
4
by: Ken Fine | last post by:
I've been living with a frustrating issue with VS.NET for some months now and I need to figure out what the problem is. Hopefully someone has run into the same issue and can suggest a fix. I...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.