Recommended pattern for data concurrency
we have this web-based project where several users will be accessing the same data. they could be viewing, editing, deleting this data, (etc) possibly at the same time.
what is the best design pattern that solves this problem?
Patterns concept hardly help you on this. Any concurrency issue is specific to business logic implementations of DAO.
Similar Messages
-
Design patterns for data access
. What design patterns can be used for data access to ensure that only a minimum amount of data is maintained in session
. What design patterns can be used for data access to
ensure that only a minimum amount of data is
maintained in sessionThat's not a design pattern, that's business logic.
Your application has to determine what "minimum" means.
Martin Fowler has lots of patterns for data access in his "Patterns of Enterprise Application Architecture". Check them out. -
Choice of design pattern for data acquisition system
Hello all
I have a trouble about selecting the suitable design pattern / architecture for a data acquisition system.
Here is the details of the desired system:
There is data acquisition hardware and I need to use it by observing parameters on User interface.
the data acquisiton period, channel list to scan should be chosen on User interface. Besides, there are many user interface interactions. e.g. if user selects a channel to add scanlist, then I need to enable and make visible some other parts on user interface.
When user completes the channel selection, then he will press the button to start data acquisition. Then I also need to show the scanned values on a graph in real time and log them in txt file.
I know that I cannot use producer consumer pattern here. because the data acquisition loop should wait for parameters to scan channels. and it works in a given period by user. so the user interface loop performs higher rate then consumer loop (data acquisition loop). it means queue will be bigger bigger. if I use notifier it will loss some data come from user interface.
is there any idea about that ? is there any suitable design pattern for this case ?
Thanks in advance
best regards
Veli BAYAR
Embedded Systems Software and Hardware Engineer
"You live in a graphical world. Why not program in one?"
Solved!
Go to Solution.johnsold wrote:
Veli,
I recommend the Producer/Consumer model with some modifications.
You might need three loops. I cannot tell for sure from your brief description.
The User Interface loop responds to the user inputs for configuration and start/stop of acquisition. The parameters and commands are passed to the Data Acquisition loop via a queue. In this loop is a state machine which has Idle, Configuration, Acquisition, and Shutdown states (and perhaps others). The data is sent to the Processing loop via a different queue. The Processing loop performs any data processing, displays the data to the user, and saves it to file. A notifier can be used to send the Stop or shutdown command from the User Interface loop to the other loops. If the amount of processing is minimal and the file write times are not too long, the Processing loop functions might be able to occur in the Timeout case of the UI loop Event structure. This simplifies things somewhat but is not as flexible when changes need to be made.
I am not sure that a Design Pattern for this exact setup exists but it is basically a combination of the Producer/Consumer (Events) and Producer/Consumer (Data) Design Patterns.
Lynn
Check out this thread: http://forums.ni.com/t5/LabVIEW/Multiple-poll-case-structures-to-event-help/td-p/2551309
There are discussions there about a 3-loop architecture that may help you.
Jeff
Jeffrey Zola -
Default format pattern for Date and Number
Hi everybody,
I'm finding it very hard: my java app runs on Tomcat 5.5, I'd like to format dates and numbers with a specific format. For example: with Locale it_it date format is "dd-mm-yyyy", my wish is to display "dd/mm/yyyy" without changing the Locale (it_it is correct). Is there an env variable to set?
Thanks.gianoele wrote:
How cai I set with a proprerty? Like -Ddate.format="dd/mm/yyyy" -Dnumber.format="###.00"?You could do that.
Then fetch it from your app and feed it to SimpleDateFormat. -
hi! i'm a java newbie and i've been tasked to create this web application. my question is what's good way / strategy to implement data concurrency?
for data concurrency, my officemate suggested this design :
if user A is editing a record in the table then that record should be locked from other users. A class, called UserAccessRightsManager, will supervise all the locked records. So, if user B wishes to edit that record, he must go through UserAccessRightsManager. Is this a good idea? If not, can you give some suggestions? I'm a bit worried with his idea. What if two users edit the same record at the same time?
would appreciate any help! thanks!What backend database are you using? I would let the db handle locking.
-
Design patterns for keypad...
Hi All,
what design patterns should I use If I need to program a front panel(
keypad+display) for a phone which is going to have a lot of many different commads?
are there any good examples ?
thanks.. What design patterns can be used for data access to
ensure that only a minimum amount of data is
maintained in sessionThat's not a design pattern, that's business logic.
Your application has to determine what "minimum" means.
Martin Fowler has lots of patterns for data access in his "Patterns of Enterprise Application Architecture". Check them out. -
Recommended throughput for Oracle data warehouse
Hi, I know up front this is going to be a vague question...but I'm trying to determine approximate I/O bandwidth for a data mart server. Right now we're hosting 3 or 4 different marts on it, but that number is going to increase.
Oracle's DW "2 day" class recommends starting with either maximum throughput from user queries, or basing it off of batch windows. Right now the server is barely used for end user queries, as we haven't yet implemented a BI tool to allow users easy access (that's underway right now). So I find it hard to base any info on that. However, it's on the way, and I'm in charge of the BI took (OBIEE). I'm having nightmares that we get OBIEE deployed, and our queries end up taking 5 minutes each to get answers... Right now, on the system basically by myself, if I do a simple "select sum(amount) from fact_ledger", where fact_ledger is a 1 Gb table (with 40 million rows), it takes almost a full minute to run. It feels like I could add this up by hand and get an answer faster...and this certainly doesn't compare with other Oracle marts / DWs I've worked on in the past.
From a batch window standpoint, all I can say is that it feels really, REALLY too slow to me. Right now, some jobs that start with a 40 million row table and join it to 6 or 7 other small tables (looking up surrogate keys) and writing to a non-logged, non-indexed output table takes over 2 1/2 hours to complete. To me this should be a 15 minute job.
We've asked IT to do a "root cause analysis" of why performance is so bad - but as part of that, the architecture group wants something more concrete than "it just feels way too slow". So does anyone have some general guidelines they can provide? I guess our detailed info would be:
- three marts, each of which has a fact table around the 30 - 60 million row level
- simple "join 30 million row staging table to look up surrogate keys" and writing results is taking 2.5+ hours
- we expect at some point to have mabe 50 - 100 users running data concurrently (spread across the marts)
- users will be performance both canned and ad-hoc analysis against it...and they are high level business users, aren't going to be happy with waiting 2 minutes for a simple answer
My start was to swag this as requiring 6 CPUs or so, which would indicate (according to Oracle's best practice docs) of needing somewhere betweeen 1.2 GB/s to 2.4 GB/s throughput. I'm assuming if it takes almost a full minute to read a 1 GB table, that our IO is currently 60 to 120 times too slow. Does that make sense?
Thanks and sorry for the lack of details...we just don't know yet.
Thx,
ScottWhy don't you start by taking an AWR report from those two hours so you can see what is the bottleneck for your system ?
-
Recommended Design for WAAS in both Data center and Branch Offices
Hi All,
I need to purchase different appliances for WAAS, but before I decide what to purchase, I need to know exactly how I am going to put these devices so that I can know which one to purchase and how the designs will be.
My environment is as follows:
I have two core routers (ASR 1000 series) at Data center, two 6509 switches (expecting to insert the ACE module, and FW module) and the I have access switches which connects servers.
At the branch offices, I am expecting to place ASR1000 series also.
Now, I need to know the recommended designs for these WAAS appliances so that, I can know in advance what to purchase(i.e. how many WAAS CM, Core WAE, and Edge WAE).
Any input will highly be appreciated.
Thanks,If you purchase the Standard Edition, your license supports:
One installation of Cisco Security Manager on one Windows-based server.
The configuration or management of 5 devices (in the Standard-5 option) or 25 devices (in the Standard-25 option). This excludes Catalyst 6500 and 7600 Series devices and their associated service modules.
If you purchase either the Standard-5 or Standard-25 license, you cannot purchase an incremental device license. Your license is fixed at either 5 or 25 devices. -
Any effective storage recommendation(s) for 2 terabytes of data?
I am responsible for data storage and backup for a mid-size ad agency. We are currently utilizing two external terabyte drives (storage capacity totalling two terabytes).
These drives are burning out regularly which is leading me to believe it is time to begin researching better options for storage and backup. (They tend to die on us just outside of warranty!)
There are 6 people in our art department and our files are backed up nightly. We are running on all the lastest and greatest Apple machines, software and operating systems.
Can anyone recommend a better, more efficient and possibly even a more cost-effective solution?
We have done some basic research into off-site storage, which I thought would be our best solution, but this has proven to be more costly than we had expected due to the amount we are storing.
Can anyone assist or make a helpful recommendation based on their own experience with storage problems?
Macbook Pro Mac OS X (10.4.8)Welcome to Apple Discussions!
If everyone is Using Mac OS X Tiger, I'd post this question in:
Using Mac OS X Tiger
If there is a mixture of Mac OS X versions being used, but Tiger is among them, then I'd still post there.
If there is a mixture of Mac OS X and Windows, you might find the Windows Compatibility forum works better for such a question.
Regardless, I'll say this much. I like the cases and drives by http://www.macsales.com/ http://www.granitedigital.com/ (Relax Technologies), and internal SATA and IDE drives by Western Digital and Seagate.
In some cases having an http://www.apple.com/xserveraid/
works better for some people than just using standard external drives. I'm not sure which those are, but the fact there is redundancy I'm sure helps a lot. There is a separate forum just for XServe RAID, which I'm sure if you posted in, people can tell you when it is wise to have one or not.
Try only to use the Discussions Forum Feedback forum for suggestions on how to improve Discussions, or if you want to alert the moderators about some posts you don't like in the forum. -
I have this doubt. I've just bought an external drive, especifically a Seagate GoFlex Desk 3 tb.
I want to know if it is recomendable to make a partion exclusively for time machine and let another one so I can put there music, photos, videos, etc that I should need to use or copy to another computer.
May half and half, 1.5 tb for time machine and 1.5 tb for data.
I have an internal hard drive of 500 GB (499.25 GB) in my macbook pro.
Any recommendation?As I said, yes. Be sure your Time Machine partition has at least 1 TB for backups.
1. Open Disk Utility in your Utilities folder.
2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
3. Under the Volume Scheme heading set the number of partitions from the drop down menu to two (2). Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed. -
Hi
I have a " AirPort Time Capsule " (firmware 7.7.3) When I try to open the data folder in "finder". Then I got the message " The operation can not be completed because the original item for " data" does not exist". I have a lot of data and I can understand why I get this message?
Anyone who can help? Thanks..
Br. BoGet a USB drive of 2TB or more.. assuming your TC is 2TB. Either preformatted Mac or plug into your Mac and format it standard Mac OS Extended Journaled in disk utility.
Do a full archive of the TC. You do this using airport utility. Do not click the erase disk.. I marked in green.. just the archive.. that is to backup the internal disk to the USB disk. It is not fast.. take it that the process will go at around 40-50GB/hr.
Once you complete the archive .. it is a direct image of the data on your TC.. you can then plug it into your computer directly.. and then try and open the files you lost.. if you cannot open them.. open disk utility and fix the permissions.
http://osxdaily.com/2015/01/13/repair-disk-permissions-mac-os-x/
Or try the methods apple recommends..
OS X Yosemite: Set permissions for items on your Mac
It is possible to fix things on the USB drive because it is locally mounted.. but you cannot fix it on TC which is network drive. -
Books about MVVM, architecture, design patterns for Windows Phone 8.1
Hi,
I'm looking for a book or books (or other resources) that explain how to develop an app with a proper architecture. I mean what each layer (bussines layer, data layer, network access) should do and how should it look like. I'm also looking for a book about
MVVM.
Right now I'm struggling with how to create a layer for network communication - how to separate classes for requests and responses, how to manage requests and create some queue of requests and also to provide some way to cancel them when they are no longer
needed, how to work with servers that use some level of security (cookies, certificates etc.).
Another thing is caching - how to design a short-term cache or a persistant cache (database), what technologies I can use etc.
Last thing that I'm struggling with is also naming. How to name classes in those layers, e.g. to distinguish between classes mapping data from some ORM database, for mapping on JSON in network communication. etc.
I hope you got the idea :)
Thanks.Currently, I don't find a book about MVVM pattern for Windows Phone 8.1, but I think MSDN and some blogs have some useful samples and conceptions: http://msdn.microsoft.com/en-us/library/windows/apps/jj883732.aspx
http://channel9.msdn.com/Series/Windows-Phone-8-1-Development-for-Absolute-Beginners
And I think your question includes too much scopes, maybe you need to split it into some blocks and get help in the related forum
Best Regards,
Please remember to mark the replies as answers if they help -
Why do I get charged for data while I am connected to WiFi?
I am having issues with data usage on one of the 5 iPhones on my plan and have been keeping track of the data on all of the phones on my plan. I have noticed that I am being billed for data at night while I am sleeping and my phone is connected to my home wifi. Why is this? Is it just a way for Verizon to make more money?
Are you certain that you are connected to your home WiFi? If you are truly connected to WiFi, then the data connection from VZW should be disconnected. I would recommend checking your settings to ensure you are truly indeed connected to WiFi in your home and if so, then I would then suggest contacting Tier 2 technical support at VZW by calling 611 from another device so that you can work with support with your phone while on the line with them.
NOTE: iOS devices do NOT support WPS directly and if you are attempting to connect your home WiFi in this fashion, you will need to log into your home router and get the exact Paraphrase for your router and enter that into your iPhone.
Hope this makes sense and helps.
Best Wishes,
The Doctor -
Hi Friends,
I Have a view named - item_sales with 4 column
Item code
Item name
Transaction_YYYYMM (Date stored in YYYYMM format )
QTY_RECEIVED
QTY_SOLD
Sample data is
ITEM_CODE ITEM NAME TRANSACTION_YYYMM QTY_RECD QTY_SOLD
AX TSHIRT 201307 3000 2000
AX TSHIRT 201308 2000 500
AX TSHIRT 201309 1000 3000
CX XLSHIRT 201307 3000 2000
CX XLSHIRT 201308 3000 2500
CX XLSHIRT 201309 3000 2500
EVERY MONTH END I WILL RUN THIS QUERY TO FIND OUT THE BELOW DETAILS
1. TO FIND ITEM_NAME WISE - QTY_RECEIVED AND QTY_SOLD ( FOR CURRENT MONTH - EXAMPLE SEP )
2. TO FIND ITEM_NAME WISE - QTY_RECEIVED AND QTY_SOLD (FOR CURRENT YEAR EXAMPLE FROM JAN TO SEP )
OUTPUT FOR SEPTEMBER MONTH LOOK LIKE THIS
SEP-MONTH JAN TO SEP
ITEM_CODE ITEM_NAME QTY_RECEIVED QTY_SOLD QTY_RECEIVED QTY_SOLD
AX TSHIRT 1000 3000 6000 5500
CX XLSHIRT 3000 2000 9000 7000
Pls advise me how to write queries for this
RdkJust FYI, you *can* edit your own posts, you know
Rdk wrote:
Transaction_YYYYMM (Date stored in YYYYMM format )
First "problem". Don't store dates as string. Store them as dates. It will save you so much headache don't the road you won't believe it.
True, this is a view, so maybe not as critical - assuming the underlying *DATA* is actually a date.
1. TO FIND ITEM_NAME WISE - QTY_RECEIVED AND QTY_SOLD ( FOR CURRENT MONTH - EXAMPLE SEP )
2. TO FIND ITEM_NAME WISE - QTY_RECEIVED AND QTY_SOLD (FOR CURRENT YEAR EXAMPLE FROM JAN TO SEP )
So yeah, based on these requirements, I'd recommend you make that column a DATE, not a string. Dates are easier to parse for date-related logic - such as month by month as you need here.
Using that, here's one way to do it:
with w_data as (
select 'AX' item_code, 'TSHIRT ' item_name, to_date('20130701','yyyymmdd') trans_dt, 3000 qty_recd, 2000 qty_sold from dual union all
select 'AX' , 'TSHIRT ' , to_date('20130801','yyyymmdd') , 2000 , 500 from dual union all
select 'AX' , 'TSHIRT ' , to_date('20130901','yyyymmdd') , 1000 , 3000 from dual union all
select 'CX' , 'XLSHIRT' , to_date('20130701','yyyymmdd') , 3000 , 2000 from dual union all
select 'CX' , 'XLSHIRT' , to_date('20130801','yyyymmdd') , 3000 , 2500 from dual union all
select 'CX' , 'XLSHIRT' , to_date('20130901','yyyymmdd') , 3000 , 2500 from dual
w_base as (
select item_code, item_name, trans_dt, qty_recd, qty_sold,
sum(qty_recd) over (partition by item_code, trunc(trans_dt, 'MM')) mm_recd,
sum(qty_sold) over (partition by item_code, trunc(trans_dt, 'MM')) mm_sold,
sum(qty_recd) over (partition by item_code, trunc(trans_dt, 'YY')) yy_recd,
sum(qty_sold) over (partition by item_code, trunc(trans_dt, 'YY')) yy_sold,
row_number() over (partition by item_code order by trans_dt desc) rnum
from w_data d
Select item_code, item_name, mm_recd, mm_sold, yy_recd, yy_sold
from w_base
where rnum = 1
IT ITEM_NA MM_RECD MM_SOLD YY_RECD YY_SOLD
AX TSHIRT 1000 3000 6000 5500
CX XLSHIRT 3000 2500 9000 7000 -
How to enter a valid Edit Pattern for Time?
I'm tring to enter a pattern for the Edit Pattern and it kept giving me the invalid pattern error.
Here is what I have for the Display Pattern: h:MM A
And for Edit Pattern: h|hh|h:MM|h A|hh A|h:MM A|hh:MM A
The textbox is set to Type: Date/Time Field.
Help is appreciated.[email protected] wrote:
> I'm tring to enter a pattern for the Edit Pattern and it kept giving me the invalid pattern error.
>
> Here is what I have for the Display Pattern: h:MM A
> And for Edit Pattern: h|hh|h:MM|h A|hh A|h:MM A|hh:MM A
>
> The textbox is set to Type: Date/Time Field.
>
> Help is appreciated.
The last two are the only valid edit patterns. All of the others are invalid. Here are the reasons:
- You have to specify the minutes
- If not using military hours (H, HH) you have to specify AM or PM
The only way to support the other patterns you are trying to use is to make it a text field and put
custom javascript validation on it.
Justin Klei
Cardinal Solutions Group
www.cardinalsolutions.com
Maybe you are looking for
-
Do i need to update the iPhoto 8.1 even after purchasing lion to use iCloud?
do i need to purchase an update of iphoto in order to use icloud?
-
Java "Syntax" should be a main button.
So I really like the idea of the new syntax and such, but I think it's annoying that 1. I have to go to "advanced" reply to use "Java" syntax, and just having to click and scroll to it can be annoying(even though it takes 10 seconds.as it ImO I love
-
Combine install cd's onto a dvd?
I dl'd the 5.2 64 bit cd images, 1-6. Can I somehow combine all the images [or at least 2-6] on 1 dvd in a manner that the installer will [automatically] find them? Thanks, -nat
-
Deleting pictures from elements
I have been deleting pictures in elements to make more room on my hard drive and just noticed a box on the screen about deleting also from the hard drive. Can anyone help me try and figure out how to sort out on my hard drive what pictures I have de
-
Hello, I have a string with values separated by a caracter and I want to split it into a list of values. I already programmed a function based on instr and substr functions but I have performance problems. Is there an Oracle standard function / packa