conny pemfors

Greenhorn
+ Follow
since Oct 19, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by conny pemfors

there is a problem with an object selector connected to a dataset consisting of composite components fields, when using insertChildren tag creating a new record, validation exception causes the fields to be cleared,
but there is a work around for it wrap around a h:panelGroup, however this panelGroup creates another bug which makes another validation error not updating the fields accordingly to the object selector.
when reselecting object. when debugging all the input components look correct according to the data in the data set, but the fields in the browser are never updated. so how do I make the h:panelGroup refreshed, or is there a better way to fix the insertChildren bug.

<!-- <h:panelGroup> -->
<cc:insertChildren/>
<!-- </h:panelGroup> -->
12 years ago
JSF
thanks for input. the issue was solved on the server side instead.
12 years ago
JSF
Iam using the rich:autocomplete component in jsf but when adding jquery scripts to remove data from the input combobox component it removes the data but puts back the data from before pressing save button.
Any ideas of where the rich component stores the input data and places it back in the combobox, I guess it has to do with the autocomplete.js script file where it renders back before save is submitted.

12 years ago
JSF

Originally posted by William Smith II:
I submitted my assignment on Dec 26th and wrote the exam on Dec 28th. My exam is still in pending status. That's 7 weeks. I'm getting frustrated!!! I'm really frustrated because I think I've seen one other individual who submitted after me and got his results back in 2 or 3 weeks.

I've already sent two emails to the who2contact email address.

Sorry, I just needed to vent.



You should write to suncert@prometric.com, and they will check the results from the http://www.certmanager.net/sun_assignment/
and add it in their Database.

There you can find the testhistory and results of all your exams.

BR
Conny

Originally posted by Alex Belisle Turcot:
Hi all,

I passed! I was hoping/aiming at a better score, but it's all behind me and it's all good

General Considerations (maximum = 100): 99
Documentation (maximum = 70): 70
O-O Design (maximum = 30): 30
GUI (maximum = 40): 31
Locking (maximum = 80): 44
Data store (maximum = 40): 40
Network server (maximum = 40): 40

Thanks all, and wish you the best!
Alex





Congrats Alex!

I passed the SCJD certification, 30th of dec 2007 with score of 344 points.
Looking forward to take the SCEA Exam, it's seems to be a quite funny assignment.


BR
Conny
Rumors that SUN is coming out with a new SCEA 1.5 in march.
is there any specific recommended reading for this certification as well.
Maybe it's better to wait for the new one if you recently took the SCJD certification.


BR
Conny

SCJP 1.5, SCJD 1.5

Originally posted by R van Vliet:
Hi conny,

I was unable to extract a question from your post. Could you please be more specific as to what you are confused about?

Also, on a sidenote, it's much easier to read code if you use the appropriate code tag.



it's the part where you use threads,
I might have another solution that looks like this, but I don't kn ow if it is correct but it seems to work.
used during update a record.
Now I use Reentrant lock as well in reservationsmanager.




[Conny - I have edited your post to put code between [code] and [/code] UBB tags. This helps keep the code readable. If you would like to see what I have done, please click on the icon that appears at the start of your post. Regards, Andrew]
[ November 22, 2007: Message edited by: Andrew Monkhouse ]

Originally posted by Alex Belisle Turcot:
Hi,

I'm not there yet.. in 2 or 3 weeks I believe..

This has been ask many times and there are few very good thread where people detail what they did...
I read some say it should not be much more than 1 page. Maybe 2-3 top.
Look it up yourself on the board, you'll find a lot of people shared their experience about their choices.txt

Regards,
Alex

[ November 20, 2007: Message edited by: Alex Belisle Turcot ]




Hi Alex, Iam getting quite confused now.
When it first comes to CPU cycles, I thought at first that using the lock would be enough in update and delete methods, but then you are thinking about threads, where do you use threads on the db side.
for instance...



[Conny - I have edited your post to put code between [code] and [/code] UBB tags. This helps keep the code readable. If you would like to see what I have done, please click on the icon that appears at the start of your post. Regards, Andrew]
[ November 22, 2007: Message edited by: Andrew Monkhouse ]

Originally posted by R van Vliet:
Hi Andrew,

Thanks for your reply and I agree, although I think in the case of the 2nd instructions the safer bet is to let the code follow the instructions to the letter (avoiding the woes of assessors that got a speeding ticket that morning) and document your reservations in choices.txt.

You make a good point about RMI. Although perhaps even in the case of RMI tracking the thread would be a viable option. I wouldnt use the thread to uniquely identify a client to begin with, but it's still a way to avoid the deadlock situation mentioned. All you'd basically care about is one thread trying to lock record X twice. After that check you can always seperately check if you're talking to the same client and deal with the request to lock appropriately, still avoiding the deadlock in the process.

I almost feel a need to apologise for the fact that I too belong to that majority that objects calling lock/unlock from the client



Hi Everybody!
Anybody who know for sure how well documented choices.txt should be.
Somehow it must be explained in detail of why certain choices have been made regarding record locking for instance, or other issues.


/Conny

Originally posted by R van Vliet:
By the way, for those that delegated locking to a seperate class (say LockManager), does anyone guard against things such as :



Since most operations requiring record lock are atomic and are guaranteed to unlock the record before returning this isn't an implementation problem, but looking solely at the scope of LockManager wouldnt it be better to disallow a thread locking the same record twice? I havent noticed anyone doing or discussing this, hence asking.



what I believe or think in my mind, is that you always should check if the record is already locked, in that case, that kind of scenario would not be any problem, can't lock a locked record.

when you do the lock operation, check first it is not already locked.
so if you have many clients connected, it always checks before whether the recordNo is locked by another user.


Conny

Originally posted by Musab Al-Rawi:
Alex's way is better but in order for you to do it you have to provide a higher layer which is the business layer.
The business layer provide the main functionalities from the client point of view, so the client won't have to invoke lock, update then unlock to do the booking operation, instead he will invoke book() which does the locking updating then unlocking.



What I have done in the client, is just as you say, I book a record, sends the command to the server, and use the update method from the data class, where I use the lock methods, so I do not involve any threads on the client, but if that is correct I think that is the best solution.

/Conny

Originally posted by Musab Al-Rawi:
Sorry for the late reply,
I am not sure if I got your question right or not.

What I understood from my assignment is isLocked() should return true if the record has been locked by the invoking thread, if this method returns false then you shouldn't allow the thread to do update/delete kind of operations.

Another thing to mention is that when you want to lock a record all what you need to do is call the lock() if the record is locked by another thread (user) then your thread should wait until the locking thread unlock() the record.

You don't have to lock on a specific record (as it may be more complicated to implement) UNLESS it is required , i.e say thread 1 is locking record 1 then thread 2 should be able to lock and change recrod 2 if it is not locked. an easier approach is: if thread 1 is locking record 1 then thread 2 can't lock record 2 until thread 1 unlocks record 1.

final thing to mention is always try to follow the following style when locking:


to make sure that the record is unlocked whether the operation fails or succeeds.




Hi Musab.
that part I get...so Iam quit done with that, but, do you use any kind of these operation from the client, or you only do the locking on the db side.

Originally posted by Musab Al-Rawi:
Hi Conny,

As an advice start with the Database first and forget about the GUI.
now in the DVD Example he is identifying the locker using an instance of the fasade (that's why he is sending "this" with the record number to the reservation manager instance).

You can use the same example in the DVD example. But make sure that your interface doesn't require you to return a magical number or cookie.

now you can improve on the design of the locking that you have in the book and most probably you have to make changes to suit your design and data.

hope that helped.

[ November 15, 2007: Message edited by: Musab Al-Rawi ]





Hi Musab,
is it ok to use the methods in Data class like this in update and delete methods handling record locking on specific records wtih recNo



[Conny - I have edited your post to put code between [code] and [/code] UBB tags. This helps keep the code readable. If you would like to see what I have done, please click on the icon that appears at the start of your post. Regards, Andrew]
[ November 22, 2007: Message edited by: Andrew Monkhouse ]

Originally posted by Alex Belisle Turcot:
Hi,

I'm not quite sure what is your question, could you rephrase for me ?

Regards,
Alex



According to the Data class you should use recNo.


however in the dvd example they do not lock database record with recordNo.
I wonder how this should be implemented or if you just have to add record lock with recNo from GUI before doing update, insert or delete.


[Conny - I have edited your post to put code between [code] and [/code] UBB tags. This helps keep the code readable. If you would like to see what I have done, please click on the icon that appears at the start of your post. Regards, Andrew]
[ November 22, 2007: Message edited by: Andrew Monkhouse ]
Hi.

According to the description of Data class.
Locks a record so that it can only be updated or deleted by this client.
If the specified record is already locked, the current thread gives up
the CPU and consumes no CPU cycles until the record is unlocked.

you should use record locking on recNo probably also on the client using the method lock(int recNo);

in my case I have done like in the dvd example,
using

maybe I should redo this part with using a similar method like this in the file access class,




Conny

[Conny - I have edited your post to put code between [code] and [/code] UBB tags. This helps keep the code readable. If you would like to see what I have done, please click on the icon that appears at the start of your post. Regards, Andrew]
[ November 22, 2007: Message edited by: Andrew Monkhouse ]