473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Best way to persists complex objects in multi-threaded app...

Hello. I have a multi-threaded app that has a few different Timers all
of which deserialize and serialize objects to perform certain
operations. At the same time, the user can be working in the app and
making changes (thus deserializing and serializing objects, as well).
I'm sure you can see my problem.

Currently, I'm using binary serialization and hashtables to persist the
state of an entire form (including listview items/subitems, etc). It
works very well (a single call to DeSer or ReSer will save/restore an
entire form into a single file)... BUT... the problem is that,
theoretically, a thread can deserialize a form in the background while
the user is working with that same form, then the user exits (which
saves changes to a file) and then the background thread finishes, which
also saves changes to the same file, thus overwriting what the user
just did.

I'd really like to find a "smarter" way to handle persistence, so that
calling objects is just as easy, but also flexible and scalable.

Are there any better options to do this? I've heard about DB
persistence, but I don't know much about it and I'm not sure of the
implications: Wouldn't the data provider I use need to be present on
any client machine where my app is installed? Would this require
mapping my entire app to a database? etc. etc.
I'm just looking for some feedback on this. Any help is appreciated.
WATYF

Nov 21 '05 #1
2 999

Why is the thread deserialising a form?
"WATYF" <WA****@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hello. I have a multi-threaded app that has a few different Timers all
of which deserialize and serialize objects to perform certain
operations. At the same time, the user can be working in the app and
making changes (thus deserializing and serializing objects, as well).
I'm sure you can see my problem.

Currently, I'm using binary serialization and hashtables to persist the
state of an entire form (including listview items/subitems, etc). It
works very well (a single call to DeSer or ReSer will save/restore an
entire form into a single file)... BUT... the problem is that,
theoretically, a thread can deserialize a form in the background while
the user is working with that same form, then the user exits (which
saves changes to a file) and then the background thread finishes, which
also saves changes to the same file, thus overwriting what the user
just did.

I'd really like to find a "smarter" way to handle persistence, so that
calling objects is just as easy, but also flexible and scalable.

Are there any better options to do this? I've heard about DB
persistence, but I don't know much about it and I'm not sure of the
implications: Wouldn't the data provider I use need to be present on
any client machine where my app is installed? Would this require
mapping my entire app to a database? etc. etc.
I'm just looking for some feedback on this. Any help is appreciated.
WATYF

Nov 21 '05 #2
A few of the forms contain listviews which hold items that specify when
certain things will happen, or what operations will be perforned... so
the Timer event will open the form, loop through the items in the
listview, and see if any of the items in it need to be run... if so, it
runs them... when it's done, it updates the items in the listview with
new information and reserializes the form so that the next time the
user opens the form, they will see the updated items in the listview.

WATYF

Nov 21 '05 #3

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

Similar topics

16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
15
by: cppaddict | last post by:
I have class with two static member objects, one of type int and one of type vector<int>. static int myStaticMemberInt static vector<int> myStaticMemberVector; I know how to initialize the...
7
by: Saintor | last post by:
What I do now is I put a value in the tag property, and using the form_current event, I run through all controls properties until the ones with the required tag value are met. Sound OK in theory,...
5
by: Trail Monster | last post by:
Ok, I've been searching the net now for several days and can't find how to do this anywhere. Version: VS 2005 Professional Release, 2.0 Framework Background: I have a complex business object...
3
by: Marc Gravell | last post by:
Kind of an open question on best-practice for smart-client design. I'd really appreciate anyones views (preferably with reasoning, but I'll take what I get...). Or if anybody has any useful links...
3
by: Rob | last post by:
Rather new to vb.net... I am wondering if the following is possible and sounds reasonable... Can connection objects and datasets be defined once (at program load) and be available for the life...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
12
by: Jeff | last post by:
I need to read about 100 lines of a csv file into memory. Each line contains 6 fields. What is the best way to store this into memory and then read it back. Is a array of a multi- dimsion...
4
by: ink | last post by:
Hi all, I am trying to pull some financial data off of an HTML web page so that I can store it in a Database for Sorting and filtering. I have been thinking about this for some time and trying...
6
by: mirandacascade | last post by:
Assume the following: 1) multi-user environment 2) when user opens app, want to run some code that retrieves some information specific to the user...retrieving this information is somewhat i/o...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.