Solution:
1) Close the solution you have open.
2) In the project folder which is giving you problems, find the .suo file and delete it.
3) Reopen your solution and add the project back.
Tuesday, March 29, 2011
Saturday, March 26, 2011
Quartz.ObjectAlreadyExistsException: Unable to store Job with name: '' and group: 'DEFAULT', because one already exists with this identification.
Problem:
Exception Caught: Quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'updateMyStuff' and group: 'DEFAULT', because one already exists with this identification.
Code:
// construct job info for every 10 seconds
JobDetail = jobDetail = new JobDetail("updateMyStuff", null, typeof(UpdateMyOneMethod));
trig = new CronTrigger();
trig.CronExpression = new CronExpression("0/10 * * * * ?");
trig.Name = " updateStuff ";
sched.ScheduleJob(jobDetail, trig);
// job for every day 12:00 am
jobDetail = new JobDetail("updateMyStuff", null, typeof(UpdateMyOtherMethod));
trig = new CronTrigger();
trig.CronExpression = new CronExpression("0 0 0 * * ?");
trig.Name = "updateStuff";
sched.ScheduleJob(jobDetail, trig);
Solution:
I was clearly very tired and not paying attention and made a miserable copy/paste error. Make sure the JobDetail has a unique name and same with the trigger! Fixed Code, changes bolded:
// construct job info for every 10 seconds
JobDetail = jobDetail = new JobDetail("updateMyStuff", null, typeof(UpdateMyOneMethod));
trig = new CronTrigger();
trig.CronExpression = new CronExpression("0/10 * * * * ?");
trig.Name = " updateStuff ";
sched.ScheduleJob(jobDetail, trig);
// job for every day 12:00 am
jobDetail = new JobDetail("updateMyOtherStuff", null, typeof(UpdateMyOtherMethod));
trig = new CronTrigger();
trig.CronExpression = new CronExpression("0 0 0 * * ?");
trig.Name = "updateOtherStuff";
sched.ScheduleJob(jobDetail, trig);
Sunday, March 20, 2011
Should I Create a Business Logic Layer?
The Business Logic Layer (BLL) is located between the Data Access Layer and the User Interface. This is where your data is traslated from Database objects, like DataTables and DataRows into Classes and Objects.
Sometimes I use them, and other times I don’t. This should become obvious in your design phase, when you learn whether or not your application is manipulating data after retrieving it from a database. If your application is CRUD (Create Retrieve Update Delete), then most likely you don’t need a BLL. It would be a waste of your time to add an unnecessary layer just because it is a “Proper Model”.
I find that with the Entity Framework the need for a business layer is further diminished. The reason is that the auto generated code, that is the Model, takes out the need to translate DataRow to an Object.
Now, the only reason left to have a business layer is for business logic. This is were much of your common code may go, like generation of reports, charts, and calculations. The last few projects I have done only had partial business logic layers. I only created them when necessary.
Subscribe to:
Posts (Atom)