Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
It is posible start a transaction in one action and excute a rollback in another? This is why I wanna do this:
I am making an application where the user can generate an order and that order can have multiple services so I have 2 models related Order and Service. There is a form with some radio buttons and textarea where the user is going to introduce the characteristics of the service and it have 2 submit buttons, one for add more services to that order and the second next. when the user click on next is going to be redirect to a page where he can see all the services and a button for save, if the user click on save then I wanna save the order and all services(5 services generate are 5 records on the table Service and one record on the table Order). But if the user start add services and in some point decide leave the page I don't wanna save anything.
I think this can be done with some sort of rollback or maybe there is another way.
short answer: no not really.
Longer answer: transactions are, by their very definition atomic. They do what is to be done within them, then either commit or rollback.
you can't spread them over two server actions the way you are proposing, because by the end of the first action, the transaction must either commit or rollback... by the time the server gets the second action - either one or the other has already happened.
The way this is usually solved is to add a State to your order. eg a boolean column called "is committed" or something similar. The order can be created in a "not committed" state - and all your other actions only fetch and work with "committed" orders. If the user leaves the page, you can have a sweeper process clean up any uncommitted orders (ie delete them if a non-committed order is over 2 hours old).
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm wondering what the best method is so associate TFS work items and bugs to customers so we can track what customers are waiting on particular bug or work item.
We have lots of customers using our product. If customers find a bug or request a feature, we would like to be able to associate that customer against a work item (There could also be multiple customers waiting on the same work item).
At the moment we are just creating a new task for a work item and assigning it a custom state called "Notify Customer" and including the client names in the title.
Can anyone think of a better method or have any suggestions on how they do this?
Update:
Decided to go with the tags for the customer name using the format "Client: Name". Then create a query for each customer.
I can think of two ways:
A: administrative access permitting, you can consider modifying the work item type using the Tools>Process Editor>Work Item Types>Open WIT from Server feature added to Visual Studio by the TFS Power Tools extension to include a custom text field which can then be used to enter the affected customer's name. If your customers are actually TFS users themselves you can mirror the functionality of the AssignedTo work item field. The latter (AssignedTo) topic however comes with a caveat.
B: depending on your TFS version, add a Tag to the work item. Example "customer:john.smith" which can later be queried as follows.
Tags are probably the easiest, or on an older TFS if you aren't using area path, then that can also be an easy place to add a customer name.
I would minimise/avoid edits to the tfs templates, as this will make your system "non standard" and will cause you problems when you next want to upgrade your tfs to a newer version or if you want to integrate any third party tools with tfs.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am looking to build a feature where folks can be notified via email when certain content is published on our website. Users would provide their email address, select a few subject areas they are interested in and the frequency in which they want to be updated (daily or weekly).
What is the best practice for building such a system?
I figured I would start with some sort of Subscriptions table (postgres) that would have the following fields:
email
subject_areas (list of IDs?)
frequency (daily/weekly)
last_emailed (timestamp)
I could build a job that would run every night against this table which would hit each row and aggregate all content that matches the subject_areas they were interested in, generate the email and throw it into a 3rd party email service like Mandrill or Amazon.
Does this seem like a good approach or is there a better way to tackle this?
The tables would likely be:
Users (email, name)
Subjects
Subscriptions (user_id, subject_id, last_emailed, frequency)
The other part you want is a background job queuing system (delayed_job, sidekiq, or resque) that you'll put the jobs in. A worker process will process jobs and send them in another process.
Cron and BG jobs go hand in hand
Cron (or a scheduler).
Find all users that have subscribed.
For each user - figure if there is new content to send them
Load up jobs for users that have new content to receive
Background Worker
For each user_subscriber_job - build email content based and user info and subscribed content
Send email out
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am trying to follow a few UI/UX best practices when developing a simple "request quote" form for my users.
I basically want them to fill only a few fields at a time as I guide them through it, giving them some feedback or update on cost depending on what they fill. And this is the important part, I only want to upload/save to the backend only once the user finished the whole wizard and clicks on "Complete" in the last panel. I don't want to have partial/unfinished "Quote" objects.
1) I have setup a navigation controller and added a few UIViewControllers with some fields, and I can basically step through them. Adding validation to the fields before jumping to the next field is no problem.
2) I use parse.com as my backend, and I have a "Quote" object, for simplicity's sake, let's say it has the following properties: firstName, lastName, location, date, options, price.
I ask for location and date first > then first and last name > then
options > I then calculate a price and show it to him/her > Then the user
can submit the whole thing to the server.
I looked around, and only found some indication to use a temporary xml file, which I then upload. Other results mainly pertain about http multi part requests, which I don't think relate.
Would core data be the ideal usage here? Any pointers in the right direction would be really appreciated.
Core Data is best used for local persistence of data, what you are doing is just capturing data to post to an REST url. Create an class that holds your data and pass it from view controller a to view controller b, etc. At the end, make the call to parse.com and submit your data. You can either add the logic to communicate to parse in your final view controller or put it a separate class.
If you want the user to be able to come back to the quote, then Core Data would be good to use.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I'm interested to find out how people deal with changes to acceptance criteria of user stories on a process level.
Example:
You write a user story with acceptance criteria for feature XYZ. That
user story gets implemented in a sprint of release 1.0. Some time
later for the 1.2 release the product owner wants the acceptance
criteria to be different (e.g. 1 minute timeout instead of 30
seconds).
How do you handle this change? How does it change the status of your original user story? We're using JIRA/JIRA Agile and I'd be specifically interested in hearing if you e.g. re-open your closed user stories and work on them in a new Sprint.
We're using Confluence to write our product specifications and the user stories in the PS are loaded directly from JIRA via a query. If one was to change acceptance criteria of the original user story and reopen it - how would one ensure that the product specification for version 1.0 wouldn't change?
EDIT:
I need to add some more information about our process: every user story has as well as the acceptance criteria some steps which can be used to test these criteria. These steps are used to generate a verification/test protocol which is used to check that all product specifications have been implemented properly.
Now this means a change to the user story would directly affect even already reviewed and signed off product specifications and test protocols since data is loaded via the jira query. I guess that this might not be an adequate way to pull the content into Confluence, something more permanent seems advisable.
Even if we weren't using these direct/dynamic queries, the question is still valid: how does a change in requirements/acceptance criteria affect the user story?
I would consider this to be a new user story, like "As a user, I would like the timeout increased to 1 minute for reasons best known to myself".
So after the product has been released the Product Owner comes back to you and says that they would like:
1 minute timeout instead of 30 seconds
This could be deemed an issue; It's not a bug as the timeout facility works fine, it's just that they have an issue with the period. Hence you could create an issue, associate it with the original story, and then break it up into tasks to implement this change.
However:
how would one ensure that the product specification for version 1.0 wouldn't change?
If the original product specification stated a timeout of 30 seconds, but you have now changed it to one minute, then there is no getting away from the fact that the specification has been changed. Creating an issue and linking it to the original story will mean that you won't need to edit the original story though.
Thank you everyone for your answers. We have since found a way suitable for us to handle changes to user stories.
What we ended up with are the following principles/steps:
Once a software version has been released all user stories which are part of the product specification for that release must not be changed anymore
If the acceptance criteria of the user story should be changed after the release, a change request is filed and linked against the story
The change request is then processed - in the course of it the affected user story is cloned, adapted to the changed acceptance criteria and then added to the product specification for the next release while the old user story is removed
The new user story can now be implemented during a sprint
This way we have a product specification for v1.0 which contains the unchanged user story and a product specification for v2.0 which contains the updated user story.
The important fact is that years later you could pick up the product specification for any version and test it against the acceptance criteria and still get a PASS. This wouldn't be the case if the original user story had been modified.
I hope I managed to explain this in sufficient clarity. Please let me know if I need to elaborate on any parts of the solution.
I would say that your original story remains good. Given that there is value in the change of timeout, you have a clear need to change the acceptance criteria for your original story. This is especially true where your tests are automated. I would create a new story:
As a
I Want to change the timeout value for fraggle thrunge bracket manipulation
So That
Writing this new story will focus the mind wonderfully on the value that this change will bring about. If it adds no value, then don't do it.
You can not change the acceptance criteria of the user story once it is done(yes, refer to definition of done).
If the product owner needs to change the user story acceptance criteria, he/she has to create new feature/user story with "Acceptance criteria".
If the change has come in the middle of the sprint and existing Acceptance Criteria will not make any sense to project, remove the user story from the sprint backlog and add this to new(change should not be accepted in the middle of the sprint) sprint with new/modified acceptance criteria.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
So my idea is to have an user A requesting any number of arrangements (any service) from another user B. Both user A and B can leave feedbacks to each user B and A (only one per user and service). Just like CouchSurfing
I had some thoughts about the setup on the database and ruby on rails, but would be glad if you would have a quick look on it, since I'm still a beginner seeking for knowledge.
Lets have a sample scenario:
But first a quick note: It's important that every user has the ability to become an acceptor or requestor.
User A requests this service off another user B (in this case user A becomes the Requestor and user B becomes the Acceptor, who needs to accept the request of user A). Once user B accepted the request, an Arragement is built having its primary key made of the ids of user A and B. Inside this Arrangement Table are several informations related to the arrangement. Once the arrangement took place, both user A and B are allowed to give feedback to the other user (but only one!)
This is why I have set up seperate tables for the Acceptor, Requestor and Arrangement. I want to control how many feedbacks a user can give database-wise.
Now each user has (for sure) a user-show-page where all of his received feedbacks are shown. Means: Every user has N feedbacks (or messages, if you see it database-wise). And that is why I extracted a Message-Table out of the Feedback-Table
In short: It should be very similar to CouchSurfing. E.G. the stay at ones home is an arrangement and both the host and guest can leave one feedback to oneanother.
What are your thoughts on this setup? Is it good/bad? How can I make it better?
Sounds reasonable, but your design limits A and B to having only one Arrangement with A as Requestor and B as Acceptor.
Generate an int id for the Arrangement to use as PK (and as the FK in Feedbacks) and you're there.