Come and join the fun with this tricky FORMS number !!!
hi,
imagine the following scenario.
user TOM is at site B and using a form to update a few records.
Meanwhile BOB at site A is doing the same on the same table. Suddenly BOB gets the "Could not reserve record" message. (They have encountered a lock)
Q. How can I programmatically inform BOB that TOM is the reason for the lock or vice versa ?
I need to get user from SQL AREA or something possibly?
Product is FORMS4.5 on win 95.
ANy ideas very welcome folks.
Please contribute.
thanks
nik.
At least until Oracle 8.1.7 there is no way to detected who is locking a record. But in Forms you can do
the following (in the next post I will discuss the benefits and limitations) :
- Create a table called user_locks with :
record_rowid rowid (primary key)
lock_id number(10)
user_locked varchar2(16)
datetime_locked date
- Define a database sequence called user_lock_id :
increment by 1
start with 1
minvalue 1
maxvalue 1073741823
cycle
- Create a procedure in the database to handle user locks :
create or replace procedure lock_user_record (
p_rowid in varchar2
) as
v_user_locked varchar2(8);
v_datetime_locked date;
v_lock_id pls_integer;
v_status pls_integer;
v_rowid rowid;
procedure insert_lock (
p_rowid in rowid,
p_lock_id in number
) is
pragma autonomous_transaction;
begin
begin
insert into user_locks
(record_rowid,lock_id,user_locked,datetime_locked) values
(p_rowid,p_lock_id,user,sysdate);
exception
when dup_val_on_index then
update
user_locks
set
lock_id = p_lock_id,
user_locked = user,
datetime_locked = sysdate
where
record_rowid = p_rowid;
end;
commit;
end;
begin
if p_rowid = 'AAAAAAAAAAAAAAAAAA' then
return;
end if;
v_rowid := chartorowid(p_rowid);
begin
select
lock_id,
user_locked,
datetime_locked
into
v_lock_id,
v_user_locked,
v_datetime_locked
from
user_locks
where
record_rowid = v_rowid;
exception
when no_data_found then
select
user_lock_id.nextval
into
v_lock_id
from
dual;
end;
v_status := dbms_lock.request(v_lock_id,6,0,true);
if v_status = 0 then -- Success
insert_lock(v_rowid,v_lock_id);
end if;
if v_status = 1 then -- Record locked by another user
raise_application_error(-20001,'Record locked by '||v_user_locked||' since '||to_char(v_datetime_locked)||' '||to_char(v_datetime_locked,'HH24:MI:SS')||'.');
end if;
if v_status = 2 then -- Deadlock detected
raise_application_error(-20002,'Deadlock detected.');
end if;
if v_status = 3 then
raise_application_error(-20003,'Parameter error trying to lock record.');
end if;
if v_status = 5 then
raise_application_error(-20004,'Illegal handle to lock record.');
end if;
end;
- On Forms redefine the trigger "ON-LOCK" :
lock_user_record(:block.rowid);
Similar Messages
-
HT201232 different iPhone come out from the box with a different serial number
i am from Turkey. on 8th january 2015 i have ordered 2 iPhone 6 from the apple store online. and make shipped them to my friend who was living in US. few days ago she returned to Turkey and give me the phones. but in one of the boxes the iPhone 6 was different than the one i ordered. both iPhones that i ordered were 64 GB. but i have received one 64 GB space gray and one 16 GB gold iPhone 6. now i don't understand how such a thing happens with a worldwide company like Apple. before i go and open a case in the court i want Apple to solve my problem as soon as possible and change my iPhone 6 with the one i have purchased throughout the Apple store in Turkey İstanbul. or if you would say that i have to ship it to the US than Apple must pay the shipping bill. or apple pay me back the difference between 64 gb and 16 gb which is 100 dollars. so i am waiting you to contact me as soon as possible about the solution of this stupid mistake. Aplle USA says talk to the Apple store in Turkey. Aplle store in Turkey says we cannot do anything since iphones bought from US. vb
Sorry, but you are not addressing Apple here, we are all users in these forums, just like you.
If you buy an iPhone from another country, the warranty and service can only be handled in the country where it has been bought. Since Apple does not sip internationally, you'll have to bring the iPhone back in person or send it to someone who can do that for you in the USA.
The warranty regulations are clear about that: Read Apple’s One Year Limited Warranty for iPhone -
Can I do this using the Time Capsule. I am not tech, so bear with me. Can I get the iPad to connect wirelessly to the TC, which connects wirelessly to the Canon MP495? Or, can I connect/network the iPad to the iMac to print?
Either way, or if there is any other solution, I would appreciate if someone would walk me through it, or point me to a plain-speaking resource.
Thankyou.
Actually, one more: I would like to connect my HP laptop as well. I have heard this is not simple, but possible.You can create a wifi network with your TC, and you can join this network with your iPad. However, your printer does not support the AirPrint protocol, so you will not be able to print from your iPad, unless you load additional software.
These are the steps:
1. (You may have completed this step already) Set up your TC to create a wireless network. You can do this from AirPort Utility on your Mac or from the AirPort Utility App on your iPad (free download from the App Store).
2. From your iPad, go to settings / wifi and join the network.
3. Download the Canon iPhone App from the App store on your iPad
4. You can now print photos from your iPad to your Canon printer.
If you want full functionality, (not just photos), there is software for your Mac that makes your printer available to your iPad through AirPrint (Printopia). The downside is, you have to purchase it, and you have to have your Mac running when you want to print from your iPad.
Good luck! -
Why do my iPhone cords for my 5 say it is not certified and may not work with this device? It's the same cord that came with my phone. The only difference is the iOS7 update.
Maps took me to the completely wrong side of town for a long standing business in town.Hello margmcarlson,
Thanks for using Apple Support Communities.
For more information on this, take a look at:
Troubleshooting iPhone, iPad, and iPod touch accessories
http://support.apple.com/kb/TS2634
Restore iPhone, iPad, or iPod touch to its factory default state. You should rarely need to use this step with an accessory issue.
Best of luck,
Mario -
I want to buy an iPad for my children for Christmas. Will they be able to play games and get on the Internet with this? Also, will they automatically be able to get on the Internet or will I have to purchase some kind of package?
Yes, they can play games - there are hundreds if not thousands of games available in the iTunes Store. Beware of the "free" games; many are free for the base game but charge for things like additional levels, "coins" etc. and those paid add-ons can add up quickly, to dozens or even in some cases hundreds of dollars. I'd strongly suggest you set up restrictions on the iPad to prevent your children from making unauthorized purchases. See:
http://ipod.about.com/od/iphonehowtos/ht/Using-Iphone-Content-Restrictions.htm
You will need an Internet provider of some sort; Apple is not a provider and so the iPad does not include a data service. You can either use a home Internet connection with a WiFi access point (aka "router") or you can get an iPad with WiFi+Cellular and sign up for a data plan with a cell carrier. WiFi through a home Internet service will probably be cheaper.
Regards. -
How can the iMessages and FaceTime be activated with this new ISO 7 update? When I enter my Apple ID & password it won't do anything. Says waiting for activation!! Help!
Hi there,
You may find the troubleshooting steps in the article below helpful.
iOS: Troubleshooting FaceTime and iMessage activation
http://support.apple.com/kb/ts4268
-Griff W. -
My computer died and I had to buy another one. Now I can't sync my ipod classic. What is the deal with this? I added songs about three months ago and it was fine. Now it won't sync. It says it can't sync because there is a duplicate file.
There are server problems right now with iMessage effecting some users. See http://www.apple.com/support/icloud/systemstatus/.
-
My network symbol keeps working on my home page even when I'm not doing anything, I know there has been problems in the past with this so has it come back, help it's killing my battery!
Close all open apps by double-tapping the home button, then swiping up and off the screen with the app window (not the smaller icon).
Reset your device: hold down the home button along with the sleep/wake button until the screen goes black and you see the Apple, then let go. (No data loss) -
New IMac is crashing randomly because of "Panic Kernel Error." Now IMac startup disk is not visible and will not mount. What the story with this machine. Running 10.6.7
Almost certainly, some sort of hardware problem on your logic board.
Make an appointment and take it to your local Apple Store: http://www.apple.com/retail/geniusbar/ -
HELLO
I was playing candy crush and I had too much problem with my bill your charge too much I want to know what is the problem with this game costTake it up with iTunes Support - we are not Apple here, we are just users like you:
http://www.apple.com/support/itunes/ww/
Cheers,
GB -
Last time I did an update...I lost most of my music...thousands of songs and had to reinstall them!!!! I am scared as **** to do another update!! I have radio shows to do and can't afford to spend the time with this. Help anyone?
A bit late for this advice now, but hopefully you'll know what to do next time.
Empty/corrupt library after upgrade/crash
Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
When you get it all working make a backup!
tt2 -
I recently got my iphone from AT&T which came with a charger and know the charger says "this cable is incompatible with this iphone and is not reliable" can anyone tell me how I can fix this or what to do?
Contact AT&T to have them replace the cable.
-
What's the go with this latest update. Half my apps don't work and the iPad runs slower? How do I go back to the old operating system?
Make sure your apps are updated. You might try Settings > iTunes & App Store > Automatic Downloads - Updates = "On".
You cannot go back to an old operating system. -
Hi everyone! WE just got an ipod touch 8G. We do have wireless internet, but can't join the network with the ipod touch. Message comes up.."unable to join the network".....very frustrating! We have tried all trouble-shooting suggestions on the site, but nothing is working. Anyone out there got any ideas for us?? The router is a Linksys WRT120N.
Thanks for any help any one can give!!!Does the iPod connect to other neworks?
Do other devices connect to the network?
What encryption are you using?
How you tried changing the type of encruption? Changing to no encryption? -
HT202213 My apple TV no longer finding my movies and photos. What's the deal with this?
My apple TV no longer finding my movies and photos. What's the deal with this?
That would be awesome, if the nearest service area wasn't 4 hours away.... It would cost me just as much in gas to drive down there as it would just to buy a cheap replacement off of ebay...
Maybe you are looking for
-
Hi All, We have a requirement to install the Business Package for MSS and ESS 1.41. Our current level of Business package for MSS and ESS is 1.0. Is it mandatory to patch the following? SAP ESS 603 SAP PCUI_GP 603 Also, please let me know if any othe
-
Change notification E_mail text doesn't work in Portal 7.0
I am changing notification E_Mail text accroding this link: <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/33/d494c86203ea40b7b44ddd471baab1/frameset.htm">http://help.sap.com/saphelp_nw04s/helpdata/en/33/d494c86203ea40b7b44ddd471baab1/framese
-
Emails disappear when placed in categories
I moved several emails to one of my categories. They were there 2 days ago, but when I wanted to access now they went missing. Yes, I am sure I didn't accidentally delete. Not the oly category gone missing.
-
More than 1 records in one cell
Hi all, I once came across someone's apex site whereby they've a form and one column contains more than one record. for e.g. customer1 ordered prducts abc, xyz, def, etc customer2 ordered one product xyz The form: Name |Address |Product |
-
User interface lags severely on my 2.2GHz mbook pro 3,1
I usually run my laptop just plugged in without battery ever since i had my first battery totally fry on me within 6 months of usage. And i needed to use my computer intensively the last few days so i plugged the battery in reset the computer reset p