Java has no function level lock?
Hi, everyone!
I am a C++ programmer before and after reading the
internal implemention method of Java Thread. I think
Java has no function level lock and only object level
lock. I mean to acquire a function lock is the same as
acquire an object's lock.
For example, when objectA.synchronizedFunctionA is called,
suppose synchronizedFunctionA is a synchronized function of
class A. Java only check whether objectA is locked. The synchronized
function synchronizedFunctionA has no individual function level
lock.
Am I correct?
If I am correct, I think in some certain application, function level
lock will be more efficient than object level lock. Even though it
should be used more carefully.
Thanks in advance,
George
You could have a custom lock object for every method to get the same functionality.
I.e. instead of...
public synchronized void mySynchMethod() {
}you'd do..
public void mySynchMethod() {
synchronize(thisMethodLock) {
}where thisMethodLock would be some object used as a lock by only that method.
Similar Messages
-
Function level personalization
Hello,
1. Can anyone give me use-case of function level personalizations in OAF.
2. Also I read that Oracle also has seeded function-level personalizations which can't be edited, why is so?
regards, Yora785174 wrote:
Hello,
1. Can anyone give me use-case of function level personalizations in OAF.The customer administrator can define functions and use them as context for granular level personalizations. For example, you can create a function-level personalization to "hide the salary field, if the user is updating an employee record, but not when the user is creating a new employee".
2. Also I read that Oracle also has seeded function-level personalizations which can't be edited, why is so?Oracle does not have given rights to change or modify it. As we can face issue while upgrading or during patching.
Thanks
--Anil -
Just updated to lion and my cctv access has stopped functioning all I get is a white screen in the middle of the control panel where the camera shots should be. I think it is caused by JAVA but am confused as when i view on snow leopard it works can you help
Open "Java Preferences" either from spotlight or your utilities folder...it's probably going to say you need to install a java runtime. Then just click install!
-
After updating to OS 10.8.3 java does not function. I've validated that the most current version of Java is installed and active in Safari. Has anyone else had this problem?
Yes indeed. See this thread - I have found a fix, but I am hoping once the engineers see this (Bug filed) that someone has an easier method, or a patch.
Something went wrong with the update in certain instances and it kills the Java plugin. Give this a shot - it takes a bit of time, but worthwhile.
https://discussions.apple.com/message/21528056#21528056
medward wrote:
After updating to OS 10.8.3 java does not function. I've validated that the most current version of Java is installed and active in Safari. Has anyone else had this problem? -
Pl sql row level locking with wait ?
Hi,
I am using oracle 10g.
I am new to Oracle locks. I have two tables Table1(id_no, employee, salary) and Table2(id_no, employee, salary).
I need to pull any requested row from Table1 into Table2 only once on demand. I have a procedure to pull data and there could be more than one requests try to call same procedure to pull a row from Table1 into Table2 at any given time.
I coded below to achieve row level lock. if one transaction gets row level lock on Table1 at 2, so other Transactions should wait till the lock is released at line 2 or 5 to avoid duplicates.
But below code is not working, I am getting duplicates when I call this using two concurrent java threads.
How do I control this concurrency issue so that I can avoid duplicate entries in Table2. Could any one please help?
1.begin
2.select 0 into emp_cnt
3.from Table1 where id=id_no
4.for update;
5.update Table1 set employee='xyz'
6.where id=id_no;
7.select count(*) into table2_cnt from Table2 where id=id_no;
8.if(table2_cnt =0) then
9.code to insert above row from Table1 to Table2;
10.end if;
11.commit;
12.End;
Edited by: 980916 on Jan 9, 2013 5:48 PMWelcome to the forums and welcome to Oracle.
Lets establish one thing right from the beginning ... the Oracle Database is not a Microsoft product.
There is no general reason to use row level locks, you should not want to use row level locks, you don't need row level locks, and you will almost never have any valid reason to consider row level locks.
That said there are two situations were it may be necessary to lock a row prior to an update or delete (possibly in a merge) and in those cases you want to use the built-in SELECT FOR UPDATE syntax. (Demo here: http://www.morganslibrary.org/reference/deadlocks.html#dlfu). But we should be clear here ... one rarely needs to use this locking mechanism as the chances of a collision in a well designed application are essentially zero.
Also as you are new to Oracle please explore the dynamic performance view V$RESERVED_WORDS and do not name objects, columns, etc. with reserved word names not that there is an excuse in any product to name a column "ID." Something Joe Celko has railed about for decades and a tradition I think we should all follow.
In the case of your posted code example (btw please read the FAQ and learn how to use tags) the solution is SELECT FOR UPDATE if locking can be justified which is unlikely.
Edited by: damorgan on Jan 9, 2013 6:11 PM -
Java-administrator password keeps getting locked
Hi,
We have a portal 7.3 in which the Java-administrator password keeps getting locked. I can't see anything in the log traces in NWA. The only thing I've found is in security_audit logfile which doesn't really say much:
#2.0 #2014 07 17 05:47:03:913#+0200#Info#/System/Security/Audit/PrincipalModification#
#BC-JAS-SEC-UME#com.sap.security.core.sda#C000AC142D1F08D90000000000003284#52888950000000002#tc~bl~txmanager~plb#com.sap.security.core.util.SecurityAudit#Guest#0#JTA Transaction : 127261#040FAA9B0D6511E4C5A4000003270576#040faa9b0d6511e4c5a4000003270576#040faa9b0d6511e4c5a4000003270576#0#Thread[RMI/IIOP Worker [0],5,Dedicated_Application_Thread]#Plain##
User account modified | USERACCOUNT.MODIFY | UACC.PRIVATE_DATASOURCE.un:Administrator | | SET_ATTRIBUTE: islocked=[true], SET_ATTRIBUTE: lockreason=[1]#
Please advice,
Thanks.Hi,
there exists a trace location that should provide useful information for such cases. It is described in SAP note:
1493272 - A user gets locked automatically
My suggestion is add the location com.sap.security.core.userlocking as
specified in the attachment to the note and once it is added, set that
location to DEBUG and wait for the user to be locked again. Hopefully additional information concerning the origin of the bad credentials will be written to traces.
Exactly how you capture the traces depends on the frequency in which
the user becomes locked. For example if the user becomes locked every
few minutes, after adding the location in the configtool and
restarting the system, I suggest using the Security Troubleshooting
Wizard to do so. Refer to note 1332726 - Troubleshooting Wizard and
its attachments. Create a custom incident that is a copy of the
Authentication incident and add this location
com.sap.security.core.userlocking to the newly created incident
Set the wizard to use this new incident for trace collection and wait
for the user to become locked. Then immediately stop the wizard's
trace collection
I
f the locking occurs less frequently than every few minutes, it is
preferable to use the NWA to adjust the severity of these locations
and their sublocations to DEBUG and wait for the issue to reoccur
com.sap.security.core.userlocking
com.sap.engine.interfaces.security
com.sap.engine.services.httpserver.HttpTraceRequest.traceRaw
com.sap.engine.services.httpserver.HttpTraceResponse.traceHeaders
com.sap.engine.services.security.authentication
com.sap.security.core.logon
com.sap.security.core.ticket
com.sap.security.core.util
com.sap.security.core.server.jaas
See Log Configuration with SAP NetWeaver Administrator
http://help.sap.com/saphelp_nw73/helpdata/en/47/af551efa711503e10000000a42189c/content.htm
Don't forgot to change these back to default severity levels after the
issue has captured in the traces
Regards,
David -
Hi Experts,
I want to lock a table as per ecord level locking . How to go for it?
Actually the table is being updated with key records simultaneously through different processes.
Regards,
Jyoti ShankarHI,
SAP provides you with the ability to restrict access to data while the table is being updated. This is fairly
simple to implement via the use of a lock object . Create the Lock Object in SE11 for that table, if that already exist then use that one..
Add the following code in-order to create the table lock. This function module must be called before any
update takes place. If a lock has already been taken out it will display the appropriate message.
CALL FUNCTION 'ENQUEUE_EZ_ZTABLENAME'
EXPORTING
mode_ZTABLENAME = 'E'
mandt = sy-mandt
KEYFIELD1 = "Value
KEYFIELD2 = "Value
KEYFIELD3 = "Value
* X_KEYFIELD1 = ' '
* X_KEYFIELD2 = ' '
* X_KEYFIELD3 = ' '
* _SCOPE = '2'
* _WAIT = ' '
* _COLLECT = ' '
* If exceptions are not used, message is displayed within FM
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Retrieve message displayed within Function Module
message id sy-msgid
type 'I'
number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
The following code will remove the lock for the specific table entries.
CALL FUNCTION 'DEQUEUE_EZ_ZTABLENAME'
EXPORTING
MODE_ZTABLENAME = 'E'
MANDT = SY-MANDT
mandt = sy-mandt
KEYFIELD1 = "Value
KEYFIELD2 = "Value
KEYFIELD3 = "Value
X_KEYFIELD1 = ' '
X_KEYFIELD2 = ' '
X_KEYFIELD3 = ' '
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
releasing the lock is mandatory,
See the link for more info.
http://help.sap.com/saphelp_nw2004s/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm
Regards
Sudheer. -
Logon failure after upgrade Windows 2003 domain functional level and schema
Before upgrade:
Windows 2003 Std server: Domain functional level 2000, Schema verion 30
Crystal Report XI R2: Authentication: Windows AD
Logon OK.
After Upgrade:
Windows 2003 Std + Windows 2008: Domain functional level 2003, Schema verion 44
Crystal Report XI R2: Authentication: Windows AD
Logon Error: An error has occurred: java.lan.NullPointerException
Is it a Tomcat problem? OR Java runtime problem? OR XI R2 problem?
Anyone can help to fix it!? Thanks!!OK, I try again in the testing lab and simplify the combination. We only consider Windows 2003 ONLY.
Before AD upgrade:
AD/Domain Controller: Windows 2003 Std server: Domain functional level 2000, Schema verion 30
Crystal Report XI R2: run on Windows 2003 memeber server
Operating OS: Windows XP/Vista/7: Authentication: Windows AD
Logon OK.
Upgrade cmbination 1
Step 1:
Upgrade Domain controller: Windows 2003 to Windows 2003 R2 (Domain functional level 2000, Schema verion 31 )
Crystal Report XI R2: run on Windows 2003 memeber server
Operating OS: Windows XP/Vista/7: Authentication: Windows AD
Logon OK.
Step 2:
Upgrade Domain Functional Level: Windows 2003 R2 (Domain functional level 2003, Schema verion 31)
Crystal Report XI R2: run on Windows 2003 memeber server
Operating OS: Windows XP/Vista/7: Authentication: Windows AD
Logon Fail
Logon Error: An error has occurred: java.lan.NullPointerException
Upgrade combination 2
Direct upgrade Domain Functional Level: Windows 2003 (Domain functional level 2003, Schema verion 30)
Crystal Report XI R2: run on Windows 2003 memeber server
Operating OS: Windows XP/Vista/7: Authentication: Windows AD
Logon Fail
Logon Error: An error has occurred: java.lan.NullPointerException
In this testing, we can conclude that the Domain Functional Level upgrade from 2000 to 2003. The MI logon will fail.
Q1. Crystal Report XI R2 cannot run on Windows 2003 server (Domain Functional Level: 2003)?
Q2. If Crystal Report XI R2 can run on Domain Functional Leve: 2003, how to fix our problem?
Do you have any idea to help us? Thanks!
Edited by: Initiator on Jul 20, 2010 6:22 AM -
Hi All,
Version - Oracle Database 10g Enterprise Edition Release 10.2.0.2.0
I have a card's data in a table. Whenver a two different sessions/threads selects the data sometimes they get the same card.
Now I need to lock the record. If Thred-1 selects then it will lock the first records and thread-2 must select the second record as the first record is locked by thread-1.
I have written a piece of code , at first session it locks one record and when second session select it selects no records.
I have takem MIN group function because I want the cards to be selected in order.
Can you please tell where is my code went wrong or need some changes. Data and code is given below.
SQL> SELECT * FROM crm_pps_cards_sz ORDER BY 1;
CARD_NO PIN SERIAL_NUMBER DATE_CREATED DATE_MERGED DATE_ALLOCATED DATE_REGISTERED
6338079966430591 9985 9950013661 12/06/2011
6338079973369543 6858 9950013660 12/06/2011
6338079978994154 7144 9950013655 12/06/2011
6338079981471778 7631 9950013654 12/06/2011
6338079986365041 7849 9950013657 12/06/2011
SQL>
Thread - 1
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.2.0
Connected as crm
SQL> set serveroutput on
SQL>
SQL> DECLARE
2 l_rec crm_pps_cards_sz%ROWTYPE;
3 CURSOR c IS
4 SELECT * FROM crm_pps_cards_sz t WHERE t.card_no =
5 (SELECT MIN(card_no) card FROM crm_pps_cards_sz)
6 FOR UPDATE NOWAIT SKIP LOCKED;
7
8 BEGIN
9 OPEN c;
10 FETCH c
11 INTO l_rec;
12 CLOSE c;
13 dbms_output.put_line('Card Allocated ' || l_rec.card_no);
14
15 END;
16 /
Card Allocated 6338079966430591
PL/SQL procedure successfully completed
SQL>
Thread - 2
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.2.0
Connected as crm
SQL> set serveroutput on
SQL>
SQL> DECLARE
2 l_rec crm_pps_cards_sz%ROWTYPE;
3 CURSOR c IS
4 SELECT * FROM crm_pps_cards_sz t WHERE t.card_no =
5 (SELECT MIN(card_no) card FROM crm_pps_cards_sz)
6 FOR UPDATE NOWAIT SKIP LOCKED;
7
8 BEGIN
9 OPEN c;
10 FETCH c
11 INTO l_rec;
12 CLOSE c;
13 dbms_output.put_line('Card Allocated ' || l_rec.card_no);
14
15 END;
16 /
Card Allocated
PL/SQL procedure successfully completed
SQL> My concern is that it must allocate in the order
6338079966430591
6338079973369543
....It is because MIN(ard_no) is able to find value from table which is locked by you thread 1 and thread 1 mentioned NOWAIT thus it thread 2 went out without getting anything.
Please check my reply to your duplicate thread "row level locking" . -
Hello experts!
A quick question if it can be one:
Is it possible to raise a forest functional level from 2003 to 2012 in a production environment (only 2003 DCs with existing roles to only 2012 DCs)? If so, is there a standard implementation of the upgrade process
(migration of roles, migration tools, etc.)?
many thanks!
Davidhi,
Thanks for posting.
Sorry i don't know if i am understanding your question. Are you talking about upgrading your DC's in your current forest to 2012 then raising the functional level?
If so, first of all you can only raise the forest and domain functional levels when all DC's in the forest and domain are at 2012 or higher.
To get your domain unto 2012 DC's there are a couple of paths you can adopt, but generally the simplest is:
1. Introduce your first 2012 / 2012 R2 DC into your existing domain, this will extend the schema with the additional attributes that are required to 2012 - this is an automatic process during promotion of your first 2012 DC.
2. Go through and start replacing your existing domain controllers. You don't normally do an inlace upgrade, the preferred method would be to use different hardware, built up the new DC to replace your existing one, then demote the existing one - keep going
through this process until all your DC's are 2012.
NB: which ever DC(s) currently holds the FSMO roles you will need to transfer these to one of your new 2012 DC's before you decommission that one.
if i've got what you were asking wrong, please let me know, otherwise hopefully this helps.
Regards,
Denis Cooper
MCITP EA - MCT
Help keep the forums tidy, if this has helped please mark it as an answer
Blog: http://www.windows-support.co.uk
Twitter: LinkedIn: -
Domain Functional Level: 2008 R2 to 2012 R2
My current forest and domain functional levels are 2008 R2. I know I can safely upgrade the functional levels in most cases, but I want to specifically know with regards to Lync.
Our entire environment, including Lync, is running on Windows Server 2012 R2. (We have no domain joined clients.)
Can I safely raise the forest and domain functional levels to 2012 R2 without impacting Lync?you can easily upgrade the funtional level without any issues since you have all the Domain Controllers on Win server 2008R2.
http://support2.microsoft.com/kb/2869728/en-us
For more details : Listed below link has the table which shows the effects of upgrading the domain functional levels to Windows 2012
http://technet.microsoft.com/en-us/library/understanding-active-directory-functional-levels
pankaj(MCT) -
SAPINST: "Database EPD has wrong compability level"
Hi
We are doing a "homogeneous system copy" of a java system:
WebAS Java 6.40 SP16 (with EP 6.0 SP16)
Basically we are changing from a 32-bit platform to a 64-bit platform and ind the process also shifting from MSSQL 2000 to 2005 and renaming the SID.
Source platform:
- MSSQL 2000
- Windows 2003 on x86
Target platform:
- MSSQL 2005
- Windows 2003 on x64 (AMD)
We are using SAPINST NW04 (patch collection version) and choosing to use a database-specific method for the database copy (backup/restore).
On the target system the RDBMS MSSQL2005 (9.00.2047.00) has been installed and the source database (EPP) has been restores (and renamed as EPD).
The error:
When running the SAPINST on the target-platform in one of the last phases when prompted for the "Database Information" (choosing "EPD"), then we get the error "Database EPD has wrong compability level"
Any idea what is wrong ?
Best regards
Tom BoHello,
U might have to consider the impact of migrating the MSSQL 2000 to MSSQL 2005 also the impact of using the 32-bit to 64-bit conversion..
U first have to consider the pre-migration checks for O.S. and DB...
dont forget to give reward point plz. -
[38073] dimension has multiple leaf levels which are not identical
Hi,
I am trying to implement a time dimension with 2 source tables.
The time dimension is from minute to year where logical table includes 2 source tables :
Source table#1 : Year,month,week,day
Source table#2: hour,minute (minute is a leaf level and chronological key)
When i try to check-in i got the following error: [38073] dimension has multiple leaf levels with are not identical.
Thank you.
MichaelHi RM
i am able to create multiple hirerachy in time dimension and assigned time_id as chronological key which is at the dimension detail level and acting as shared child level for both of them......
I have created AGO function for calendar year as
AGO(Test."Fact".amount_sold, Test."Time Dim"."Calendar Year", 1)
but when i have used AGO column in answers i am getting below mentioned error:-
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22046] To use AGO function, the query level ('Calendar Year, Fiscal Year') must be a static level. (HY000)
any suggestion would be appreciated to solve this.
thanks & regards -
ADMT Error Functional Level not supported
Hey there,
we are about to migrate to 2003-Domains to one 2012R2.
We installed ADMT Tand configured the prerequisites.
At initializing ADMT by migrating a global group, if i choose the pdc emulator of the source domain i got an error:
The domain functional level of the domain... is not supported...
Only a domain functional level higher than Windows 2000 is supported...
The Domain and Forest Level is 2003!?!
Our Domain Names are:
source1.customer.com (Netbios: Source1)
source2.customer.com (Netbios: Source2)
target.customer.com (Netbios: target)
My migration account is domain Admin in te target domain and member of built-in Administrators in the source domains...
The Auditing has been set, and also the
TcpipClientSupport Values (should not be required, but i found some posts about it...)
AllowNT4Crypto in the target domain has also been set...
If i choose another dc in the source domain i amable to proceed and get an error after Group options with Migrate SID selected:
Could not verify auditing and TcpipClientSupport on domains. Will not be able to migrate SIDs; the given domain is not available, or no connection possible....
any ideas?Hi ,
Based on your description, there are two issues you meet.
You choose the PDC as the source domain when migrating a global group, you get the below error,
The domain functional level of the domain... is not supported...
You migrate SID when you choose another DC, you get the below error,
Could not verify auditing and TcpipClientSupport on domains. Will not be able to migrate SIDs; the given domain is
not available, or no connection possible....
If I have misunderstood your concern please let me know.
As for the first issue, I suggest you need check
the function level of the SOURCE domain. here is detail step,
Logon one of the source DCs and open the ADCU
Right click the domain name and select the properties
You can see the function level of your source domain
As for the second issue, it is about SID history
migration, here I give you the steps for you check,
Enable auditing of Account Management in the Target domain and source domain
Create a domain local group called <domain>$$$ in source domain
Create the following registry entry on the source domain
PDC
HKLM\System\CurrentControlSet\Control\LSA\TcpipCientSupport: DWORD : 0x1
If you need further assistance, please feel free to contact me.
Regards.
Bryan Yuan
Please remember to mark the replies as answers if they help -
Raising the functional level on a large forest/domain with a DC offline?
Hello All
I've done what research that I can and haven't been able to find a definitive answer outside of people purposely taking a DC offline while raising the functional level of a forest in case they need to do an authorative restore, but I have a bit of a different
situation and I just need to confirm something.
I have to perform the task on a very large AD infrastructure that includes 90+ domain controllers globally and I've run into a scheduling conflict that is out of my control. One of the locations overseas will be going through some maintenance during
my time window when I will be raising the functional level of the forest and domain.
The question is, what happens to the DC that is offline during this period? Once it is restarted, do the changes replicate to that DC, or do I need to perform the task in place for that DC? If anyone has any links or instructions on how to bring a DC online
after the functional level of both the forest and domain have been raised, please let me know.The DC can be offline and it won't be an issue. when it comes back online the changes should replicate to it. Just don't keep it offline longer than the tombstonelifetime.
Paul Bergson
MVP - Directory Services
MCITP: Enterprise Administrator
MCTS, MCT, MCSE, MCSA, Security, BS CSci
2012, 2008, Vista, 2003, 2000 (Early Achiever), NT4
Twitter @pbbergs http://blogs.dirteam.com/blogs/paulbergson
Please no e-mails, any questions should be posted in the NewsGroup.
This posting is provided AS IS with no warranties, and confers no rights.
Maybe you are looking for
-
Push notifications are not working at all. They used to come in but very sparingly. They don't come in at all now. Im using push enabled apps(Beejive & Boxcar). I have notifications enabled on the ipod and both apps settings are set to push enabled.
-
Help! Apple ID won't allow update of Apps
My daughter's iPad will not allow me to update several of her apps. When I try to update them it will not recognize my Apple ID. I can download a new app from the App Store without an issue. I deleted the account and reloaded it without a problem. De
-
Screen shows dim 'charged' icon - ipod doesn't sleep properly
I am having the same issue as described in the thread below and see no answer there. I can fully charge my ipod and it plays, etc. fine. When I try to put it to sleep, it goes black for a second and the comes back to dim with the "charged" icon on th
-
Table control in sales order screen(VA01)
Hi Guys, I am trying to do table control i.e shifting columns as desired in the sales order, but not able to do it. can any one help me the process of shifting columns in sales order screen. Example: Shifting customer rial matenumber column to Item c
-
Unable to compile form FRM:30087
Im getting a FRM 30087 compiling a new form. I'm using f60gen on the UNIX side and the permissions on the dir is 751, as applmgr user, it looks like I have permissions to write. Please help.