473,763 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
+ 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("Sessio nID") 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
"ImportedPI NS" 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_En d" 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.R emove("Template s")
'The session variables simply expire on session end...

'Clean up/recreate the temp tables ImportedFiles, DisplayFiles, etc:
cnSQL = New
SqlConnection(S ystem.Configura tion.Configurat ionManager.AppS ettings("Connec tionString"))
cnSQL.Open()

cmd = New SqlCommand("[CreateTableImpo rtedPins]", cnSQL)
cmd.CommandType = CommandType.Sto redProcedure
cmd.ExecuteNonQ uery()

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 922

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

Similar topics

10
1924
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 singleton class has amongst other stuff the following line of code in it: Private m_DL_DBPath As String = System.Configuration.ConfigurationSettings.AppSettings("DMDatabasePath") As you guess, it must read a string containing the path. Based on this...
2
1450
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 the system at a higher level view and wanted some ideas on what would be the best design of the system in terms of performance , managability and scallability. I was thinking of three database tables , one not very urgent , urgent and very urgent ....
14
1345
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 we're a small company, I'd like to design this with the mindset of a larger company from the start. This will be an ongoing project to encompass a lot of needs, which will generally be variations on standard themes: Customer account management,...
3
2270
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
1273
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 VB6 app, the original programmer used 5 timers to periodically scan a document, process it, and display thumbnail images of the scanned document. These 5 timers implement 5 different subroutines that enable this process. In my conversion of this...
11
1775
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 aborted? The only reasonable way I see here is to use a exception but everybody is telling exceptions should not be used for control flow. I just can't think of another reasonable way to deal with this. Are there any good books that teach how to do great...
1
1705
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 example, a control that provided catalogue information. As I envisage this, the control would be given a single argument (the end user identifier) and it would return the required catalogue information as an HTML page "fragment".
0
3697
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 database calls (using a separate DB handler class). "combo1" contains a list of countries and is fairly static, it can be added to but no other external events cause a change in its population. "combo2" however is populated with a list of options...
8
1872
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 derived from X as the following: __interface X {
4
2467
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 suspect some permissions problem. I'm running VS.NET 2008 in Vista. Symptoms and observations: * ASP.NET's native ImageMap and Image controls work just fine and provide a design-time preview of images that are referenced via the ImageUrl property *...
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9938
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8822
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
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 we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.