Using public static object for locking thread shared resources

Lets Consider the example,
I have two classes
1.  Main_Reader -- Read from file
public  class Main_Reader
     public static object tloc=new object();
       public void Readfile(object mydocpath1)
           lock (tloc)
               string mydocpath = (string)mydocpath1;
               StringBuilder sb = new StringBuilder();
               using (StreamReader sr = new StreamReader(mydocpath))
                   String line;
                   // Read and display lines from the file until the end of 
                   // the file is reached.
                   while ((line = sr.ReadLine()) != null)
                       sb.AppendLine(line);
               string allines = sb.ToString();
2. MainWriter -- Write the file
public  class MainWriter
      public void Writefile(object mydocpath1)
          lock (Main_Reader.tloc)
              string mydocpath = (string)mydocpath1;
              // Compose a string that consists of three lines.
              string lines = "First line.\r\nSecond line.\r\nThird line.";
              // Write the string to a file.
              System.IO.StreamWriter file = new System.IO.StreamWriter(mydocpath);
              file.WriteLine(lines);
              file.Close();
              Thread.Sleep(10000);
In main have instatiated two function with two threads.
 public string mydocpath = "E:\\testlist.txt";  //Here mydocpath is shared resorces
         MainWriter mwr=new MainWriter();
         Writefile wrt=new Writefile();
           private void button1_Click(object sender, EventArgs e)
            Thread t2 = new Thread(new ParameterizedThreadStart(wrt.Writefile));
            t2.Start(mydocpath);
            Thread t1 = new Thread(new ParameterizedThreadStart(mrw.Readfile));
            t1.Start(mydocpath);
            MessageBox.Show("Read kick off----------");
For making this shared resource thread safe, i am using  a public static field,
  public static object tloc=new object();   in class Main_Reader
My Question is ,is it a good approach.
Because i read in one of msdn forums, "avoid locking on a public type"
Is any other approach for making this thread safe.

Hi ,
Since they are easily accessed by all threads, thus you need to apply any kind of synchronization (via locks, signals, mutex, etc).
Mutex:https://msdn.microsoft.com/en-us/library/system.threading.mutex(v=vs.110).aspx
Thread signaling basics:http://stackoverflow.com/questions/2696052/thread-signaling-basics
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • !! help using: public static Boolean valueOf(String s)

    I am trying to use this simple function to convert a string value to a boolean. According to the documentation for this Boolean method (public static Boolean valueOf(String s)), this should work:
    Example: Boolean.valueOf("True") returns true.
    As a test, I tried to run this line of code:
    tmp_bool = Boolean.valueOf("True");
    I get this compilation error:
    test_file.java:10: incompatible types
    found : java.lang.Boolean
    required: boolean
    tmp_bool = Boolean.valueOf("True");
    .....................................^
    According to the documentation for SDK 1.4, there is a new function:
    public static Boolean valueOf(boolean b)
    It seems like the commpiler is focusing on this new version of the valueOf() method, and ignoring the case where a String is the parameter. Why won't it use the version that takes a String? What confuses me even more is that I am running version 1.3.1, and the new valueOf(boolean b) function is not mentioned in its documentation.
    Am I somehow using the method wrong?
    Thanks!

    OK, I think I understand now. Thanks.
    Let me make sure i have this right...
    So basically, if you use variable types of Boolean and need to pass them to methods that take booleans, would you have to call the booleanValue method first?
    ex:
    Boolean bool_obj;
    //example method that takes a boolean
    //test_method(boolean b);
    test_method ( bool_obj.booleanValue() );
    is that right?

  • Use public SSL certificate for WebAccess 8 on SLES10 Linux S

    Currently my WebAccess 8 server is running on NetWare. I want to move my WebAccess to SLES10 SP3 server and use public SSL certificate from third-party on SLES 10. I think this is just to get apache to use the public cert on SLES 10 Linux server and nothing to change on WebAccess, right?
    Thanks in advance.
    Wilson

    wilsonhandy wrote:
    > Currently my WebAccess 8 server is running on NetWare. I want to move
    > my WebAccess to SLES10 SP3 server and use public SSL certificate from
    > third-party on SLES 10. I think this is just to get apache to use the
    > public cert on SLES 10 Linux server and nothing to change on
    > WebAccess, right?
    Yeah, it's purely an Apache config. No need to do anything to
    WebAccess just to get SSL working.
    Novell Knowledge Partner
    Enhancement Requests: http://www.novell.com/rms

  • How to revoke access of PUBLIC permissioned objects for one DB User.

    Hi
    I am using 10.2.0.4.0 , and i have a production1 schema and production2 schema in one Database.
    Some of the objects of Production1 schema having PUBLIC permissions.
    Eventhough some of the Production1 schema objects are PUBLIC production2 schema should not able access.
    Is it possible, if possible can you help me.
    Thanks in Advance.

    To add to what others have already posted consider replacing the grants to public with grants to a role and grant that role to all users except the username in question and future users who fall into the same category as far as what you want them to see.
    If you cannot change the public grants then you basically have to live with the target user having access to the objects.
    IF public synonyms are used to access the objects then in the target user account you could potentially create a set of private synonyms that point to an empty set of tables by the same name. In the case of where access is via an application under the target user username this would mast the tables of interest; however, if the user has direct access to Oracle it would not stop them from accessing the objects using the owner.table_name format as this would bypass using the private or public synonyms.
    Generally speaking all object access privileges should be granted to user created roles and usernames should be granted only those roles necessary for them to perform their job related tasks.
    HTH -- Mark D Powell --

  • Values in Public Static Object between Server Program & Servlet Program

    Hi all.
    I don't understand how to solve this problem.
    I am trying to refer a shared variable(file) at webbrowser & sever demon program at the same time.
    my code is..
    <pre>
    // write program ( called by server p/g & servlet p/g )
    public class WriteWhat
    public synchronized static String write(String what) throws Exception
    String FileName = "/home/myAccount/testFile";
    char intxt[] = new char[LogData.length()];
    what.getChars(0,what.length(),intxt,0);
    try // if File Exist
    FileWriter fw = new FileWriter(FileName,true);
    fw.write(intxt);
    fw.close();
    catch(Exception e) // if File NOT Exist
    finally
    return(FileName);
    </pre>
    The Testfile is updated fine at servlet program called
    but does Not Work at SERVER PROGRAM CALL (with No Error Message)....T.T
    sorry about my english...but you will know what I mean.
    Regard, devport.

    to be clear, you want 2 programs to append to the same file...
    FileWriter 's constructor may fail (throw an exception) if the file is already open (depends on operating system)
    you really should use the catch(IOException){
    to give you or your program a better idea of whats going on...
    what operating system are you using, or does this code need to work anywhere?

  • Oracle modrator ---please explain the reason for locking thread

    Hi,
    https://forums.oracle.com/thread/2583144
    and your active discussion at
    https://forums.oracle.com/thread/2583143
    the first above mentioned 2  threads for creating character sets with existing database without taking backups.It was crucial tasks and below mentioned thread was creating new database and find out the ways for charactersets .both are different threads and ways to work and as well as methodology
    i will be highly greatful , if u can explain the reason for blocking below mentioned thread
    creating addtitional database
    thanks

    It is all the same issue.
    ... manipulation and/or creation of databases with changes in character sets and how those character sets influence the functionality of the databases.
    Keep your thoughts, conclusions and responses to those that reply to you in one contiguous thread.
    Keep the evolution of your issue in one place.
    This site is an online user-to-user forum.
    It exists for more than just you.
    Once your discussions are finished, others are going to read them and (hopefully) learn from them so that they don't even need to post a new thread of their own.

  • Use of 'static' keyword in synchronized methods. Does it ease concurrency?

    Friends,
    I have a query regarding the use of 'synchronized' keyword in a programme. This is mainly to check if there's any difference in the use of 'static' keyword for synchronized methods. By default we cannot call two synchronized methods from a programme at the same time. For example, in 'Program1', I am calling two methods, 'display()' and 'update()' both of them are synchronized and the flow is first, 'display()' is called and only when display method exits, it calls the 'update()' method.
    But, things seem different, when I added 'static' keyword for 'update()' method as can be seen from 'Program2'. Here, instead of waiting for 'display()' method to finish, 'update()' method is called during the execution of 'display()' method. You can check the output to see the difference.
    Does it mean, 'static' keyword has anything to do with synchronizaton?
    Appreciate your valuable comments.
    1. Program1
    public class SynchTest {
         public synchronized void display() {
              try {
                   System.out.println("start display:");
                   Thread.sleep(7000);
                   System.out.println("end display:");
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public synchronized void update() {
              try {
                   System.out.println("start update:");
                   Thread.sleep(2000);
                   System.out.println("end update:");
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              System.out.println("Synchronized methods test:");
              final SynchTest synchtest = new SynchTest();
              new Thread(new Runnable() {
                   public void run() {
                        synchtest.display();
              }).start();
              new Thread(new Runnable() {
                   public void run() {
                        synchtest.update();
              }).start();
    Output:
    Synchronized methods test:
    start display:
    end display:
    start update:
    end update:
    2. Program2
    package camel.java.thread;
    public class SynchTest {
         public synchronized void display() {
              try {
                   System.out.println("start display:");
                   Thread.sleep(7000);
                   System.out.println("end display:");
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public static synchronized void update() {
              try {
                   System.out.println("start update:");
                   Thread.sleep(2000);
                   System.out.println("end update:");
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              System.out.println("Synchronized methods test:");
              final SynchTest synchtest = new SynchTest();
              new Thread(new Runnable() {
                   public void run() {
                        synchtest.display();
              }).start();
              new Thread(new Runnable() {
                   public void run() {
                        synchtest.update();
              }).start();
    Output:
    Synchronized methods test:
    start display:
    start update:end update:
    end display:

    the synchronized method obtain the lock from the current instance while static synchronized method obtain the lock from the class
    Below is some code for u to have better understanding
    package facado.collab;
    public class TestSync {
         public synchronized void add() {
              System.out.println("TestSync.add()");
              try {
                   Thread.sleep(2000);
              } catch (InterruptedException e) {
                   e.printStackTrace();
              System.out.println("TestSync.add() - end");          
         public synchronized void update() {
              System.out.println("TestSync.update()");
              try {
                   Thread.sleep(2000);
              } catch (InterruptedException e) {
                   e.printStackTrace();
              System.out.println("TestSync.update() - end");          
         public static synchronized void staticAdd() {
              System.out.println("TestSync.staticAdd()");
              try {
                   Thread.sleep(2000);
              } catch (InterruptedException e) {
                   e.printStackTrace();
              System.out.println("TestSync.staticAdd() - end");
         public static synchronized void staticUpdate() {
              System.out.println("TestSync.staticUpdate()");
              try {
                   Thread.sleep(2000);
              } catch (InterruptedException e) {
                   e.printStackTrace();
              System.out.println("TestSync.staticUpdate() - end");
         public static void main(String[] args) {
              final TestSync sync1 = new TestSync();
              final TestSync sync2 = new TestSync();
              new Thread(new Runnable(){
                   public void run() {
                        sync1.add();
              }).start();
              new Thread(new Runnable(){
                   public void run() {
                        sync2.update();
              }).start();
              try {
                   Thread.sleep(3000);
              } catch (InterruptedException e) {
                   e.printStackTrace();
              new Thread(new Runnable(){
                   public void run() {
                        sync1.staticAdd();
              }).start();
              new Thread(new Runnable(){
                   public void run() {
                        sync2.staticUpdate();
              }).start();
    }

  • Error while saving data using two entity objects (EO)

    Hi All,
    i am using two entity objects for saving the date in two different tables.
    on my page i am having two tables and two save buttons for saving the data in the respective tables.
    if i am not entering any data on the first table and putting valid data on the second table and click on the save button.
    it is going into error saying "Null Pointer Exception"..
    i am using getTransaction.commit() in my AM.
    so it is trying to save all the data in both the tables.
    i want to commit data of the respective table for which the save button is clicked.
    Waiting for ur reply

    Hi,
    i am using the following code for saving the data in the AM
    // TO SAVE THE JOB ASSIGNMENT DETAILS
    public void saveJobAssignmentDetails(String projectId)
    EmpAssignmentVOImpl empAssignVO = getEmpAssignmentVO1();
    getTransaction().commit(); // Line where i am getting the error
    rowNumberCountJobAssign = 0; // IN JOB ASSIGNMENT
    // EXECUTING THE DISPLAY FUNCTION AGAIN SO TAHT ALL SAVED FIELD ARE READONLY AS REQUIRED
    displayJobAssign(projectId);
    if(empAssignVO.getRowCount() != 0)
    throw new OAException("Job assignment details have been saved successfully. ",OAException.CONFIRMATION);
    Stack trace :
    oracle.apps.fnd.framework.OAException: oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Insert": SQL Statement "BEGIN INSERT INTO pa_job_bill_rate_overrides(START_DATE_ACTIVE,LAST_UPDATE_DATE,LAST_UPDATED_BY,CREATION_DATE,CREATED_BY,LAST_UPDATE_LOGIN,BILL_RATE_UNIT,PROJECT_ID,RECORD_VERSION_NUMBER,JOB_BILL_RATE_OVERRIDE_ID,RATE_CURRENCY_CODE) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11) RETURNING JOB_BILL_RATE_OVERRIDE_ID, JOB_ID, START_DATE_ACTIVE, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN, RATE, BILL_RATE_UNIT, PROJECT_ID, TASK_ID, END_DATE_ACTIVE, RECORD_VERSION_NUMBER, RATE_CURRENCY_CODE, DISCOUNT_PERCENTAGE, RATE_DISC_REASON_CODE INTO :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24, :25, :26, :27, :28; END;".
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:972)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:721)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.webui.jobBillRateAndAssignmentCO.processFormRequest(jobBillRateAndAssignmentCO.java:357)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01400: cannot insert NULL into ("PA"."PA_JOB_BILL_RATE_OVERRIDES"."JOB_ID")
    ORA-06512: at line 1
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1983)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1141)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2154)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2036)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2880)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:622)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:698)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:371)
         at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:5108)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.schema.server.JobBillRateEOImpl.doDML(JobBillRateEOImpl.java:124)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:4015)
         at oracle.apps.fnd.framework.server.OAEntityImpl.postChanges(OAEntityImpl.java:1676)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2694)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2540)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1783)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:1976)
         at oracle.apps.fnd.framework.server.OADBTransactionImpl.commit(OADBTransactionImpl.java:680)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.server.jobBillRateAndAssignmentAMImpl.saveJobAssignmentDetails(jobBillRateAndAssignmentAMImpl.java:772)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:189)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:721)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.webui.jobBillRateAndAssignmentCO.processFormRequest(jobBillRateAndAssignmentCO.java:357)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    java.sql.SQLException: ORA-01400: cannot insert NULL into ("PA"."PA_JOB_BILL_RATE_OVERRIDES"."JOB_ID")
    ORA-06512: at line 1
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1983)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1141)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2154)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2036)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2880)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:622)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:698)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:371)
         at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:5108)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.schema.server.JobBillRateEOImpl.doDML(JobBillRateEOImpl.java:124)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:4015)
         at oracle.apps.fnd.framework.server.OAEntityImpl.postChanges(OAEntityImpl.java:1676)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2694)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2540)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1783)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:1976)
         at oracle.apps.fnd.framework.server.OADBTransactionImpl.commit(OADBTransactionImpl.java:680)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.server.jobBillRateAndAssignmentAMImpl.saveJobAssignmentDetails(jobBillRateAndAssignmentAMImpl.java:772)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:189)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:721)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.webui.jobBillRateAndAssignmentCO.processFormRequest(jobBillRateAndAssignmentCO.java:357)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)

  • Sun is Locking threads ?

    What's going on with the Sun forum ? First they took away the ability to filter search results to IDM ( google returns better results than the search ) , now they are locking threads ?
    What are the rules for locking threads? 2 year old threads ? 3 years old ? How would the public know this new Sun Policy ? I've seen plenty of threads that were old in a lot of forums that are revived after 3 years. Believe it or not, sometimes same issues will pop up regardless of the age of the thread.
    I would ask Sun not to lock them simply because people are still using older versions of software and there are questions that pertain to them that could be resolved. Asking someone to simply open a new question while pointing to another thread might cause less responses when threads begin pointing to other threads that are pointing to other threads, and so on.
    my 2 cents

    Here are more detail to clear this up a bit:
    1) Action event is fired when a combox gets a mouse click on it the first time (user haven't select anything yet), after it got focus, it won't fire this event. A comboboxchange event is generated instead of a got focus event.
    2) I prevent the action from fire when it's updated programtically by setting disable event (actionevent) but that doesn't work (I did this on the combo box event).

  • Locked threads, instead of hiding "reply" link change word to "Locked"

    Based on this thread: http://social.microsoft.com/Forums/en-US/cc444c7a-a838-4a16-ac57-8f315475b602/how-does-one-reply-to-a-post-i-see-no-reply-button?forum=reportabug
    It seems that for locked threads, people can scroll past the the "Lock" icon too quickly to realize, and then not understand why they can't reply.  I
    Instead of hiding the reply link, I suggest changing the "reply" text to "Locked" for locked threads, and have it not be a hyperlink.
    Thanks,
    Mike
    MSDN and TechNet Subscriptions Support

    Your AGP bus uses more bandwith than the PCI bus, thus making the OC more dependend from the AGP bus. And if your AGP slot will drain more CPU power and fragile as AGP can be, it will not tolerate errors due higher clock speeds. Mhz += Stability -. Notice: PCI is 33 Mhz/ AGP is 66/133 Mhz... . As you see there is less margin for errors. While you overclock the CPU will make tolerable errors: NP with PCI... But AGP... will take it to the MAX. [I hope this reply is No nonsense]

  • Unique id for calling thread

    A stored proc can be called by any of the say 200 threads from within a pool of java connections that all sign on with say USER1. Another similar pool can call the same proc that are signed on with USER2. Inside the proc I need to store some SYS_CONTEXT info and retrive it within the same call. I cannot use a package HEADER variable beacuse this is not private to the thread. I cannot use a global variable in the package BODY because between storing the value in the BDY global variable and retrieving it another thread can call the same proc and access the BODY global variable.
    I decide to store in the info ina SYS_CONTEXT using a unique identifier for this thread as the ATTRIBUTE and the info in the VALUE. To compose the unique id for this thread I can issue the following SQl. Which combo will guarantee me a unique id for tis thread that called the stored proc. The calls are synchronous meaning once a thread obtains a connection from the pool to call the stored proc it does not give it up until the proc completes and returns a result to the thread.
    SELECT
    SYS_CONTEXT('USERENV','SESSIONID')
    ,SYS_CONTEXT('USERENV','SESSION_USER')
    ,SYS_CONTEXT('USERENV','SESSION_USERID')
    , ,SYS_CONTEXT('USERENV','SID')
    ,SYS_CONTEXT('USERENV','HOST')
    ,SYS_CONTEXT('USERENV','INSTANCE')
    INTO
    v_sessionid
    ,v_session_user
    ,v_session_userid
    ,v_host
    ,v_instance
    FROM
    DUAL
    ;

    Please don't abuse the forums by posting in many places.
    General Database Discussions

  • Third party app for locking sms, contacts, gallery...

    I have nokia E5, i wana specialy lock sms., contact., i have used a few app for locking but those apps used net connection which drains bettry.
    Any ideas plz? Urgent...

    Presumably you have looked at Advance Device Locks?
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • Rfc static libraries for Unicode (Linux)

    Hi all!
    Does anybody know if it is possible to use RFC static libraries for Unicode on Linux?
    I can compile and link my application, but when I am running it, I get message:  "undefined symbol: strtolU16". librfcu.a  is the only static library, which is provided in RFCSDK. Do I need to link my application with any other library?
    Everything works fine with non-unicode static library.
    Thank you in advance,
    Elena

    Oracle does not provide any static libraries for MS Windows.

  • Shared Objects for Threads

    Hi,
    Currently studying for SCJP exam and wondering is there a different between the following codes
    public class Test extends Thread
    static Object obj = new Object();
    static int x, y;
    public void run()
       synchronized(obj)
         for(;;)
          x++; y++; System.out.println(x+" "+y);
    public static void main(String[] args)
       new Test().start();
       new Test().start();
    }and
    public class Test extends Thread
    Object obj = new Object();
    static int x, y;
    public void run()
       synchronized(obj)
         for(;;)
          x++; y++; System.out.println(x+" "+y);
    public static void main(String[] args)
       new Test().start();
       new Test().start();
    In the first code example, is there a shared object between created threads and the second example, is their still a shared object between threads or is a new object created for each thread?
    Cheers!

    Hi,
    In first case, you are acquiring lock on a static object that is of course shared (basic concept) by all instances(of Test). So, for any thread of any instance(of Test) to execute the synchronized block has to wait till any other thread of any other instance(of Test) comes out of synchronized block. It means, all the instances (of Test) are synchronized. In this scenario, you have infinite for loop within synchronized block and you are starting two threads. The thread which enters the synchronized block first will keep on executing and the other thread will never get chance to enter synchronized block.
    In second case, as you are acquiring lock on an object, all the threads of a particular instance (of Test) will be synchronized. In this scenario, again you have infinite for loop within synchronized block and you are starting two threads on two different instances. Hence, both the threads will keep on executing in parallel.
    I hope, you have already executed both the examples and observed output. And also hope that the above explanation will help you to understand the difference between two scenarios.
    Note: Use System.out.println(Thread.currentThread().getName() + " " + x + " " + y); in your synchronized block to track which thread is printing the output.
    Thanks,
    Mrityunjoy

  • What is the use for lock object and how to use the lock objects

    Hi Guru's,
    I am new to ABAP .Can you please clarify the that what is the use of lock object and how to use the loct object .what is use of the Deque & Enque  function modules .

    hi ,
    below are some minfo about lock objects :
      Lock Objects
    These types of objects are used for locking the access to database records in table. This mechanism is used to enforce data integrity that is two users cannot update the same data at the same time. With lock objects you can lock table-field or whole table.
    In a system where many users can access the same data, it becomes necessary to control the access to the data. In R/3 system this access control is built-in on database tables. Developers can also lock objects over table records.
    To lock an object you need to call standard functions, which are automatically generated while defining the lock object in ABAP/4 dictionary. This locking system is independent of the locking mechanism used by the R/3 system. This mechanism also defines LUW i.e. Logical Unit of Work. Whenever an object is locked, either by in built locking mechanism or by function modules, it creates corresponding entry in global system table i.e. table is locked. The system automatically releases the lock at the end of transaction. The LUW starts when a lock entry is created in the system table and ends when the lock is released.
    Creating Lock Objects
    Lock object is an aggregated dictionary object and can be defined by using the following steps:
    o From initial data dictionary screen, enter the name for the object, Click Lock object radiobutton and then click on Create. The system displays a dialog box for Maintain Lock Objects screen
    o Enter short text as usual and the name for primary table.
    -Save
    -Select Tables option
    From this screen you can:
    Select secondary tables, if any, linked by foreign key relationship.
    Fields for the lock objects. This option allows you to select fields for objects (R/3 system allows locking up to record level). Lock object argument are not selected by user but are imposed by the system and includes all the primary keys for the table.
    1) Exclusive lock: The locked data can only be displayed or edited by a single user. A request for another exclusive lock or for a shared lock is rejected.
    2) Shared lock: More than one user can access the locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.
    3) Exclusive but not cumulative: Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. All other lock requests are rejected.
    Also, last but not the least, locking the object is logical (locking with any enqueue ) .so, you have to use the lock object while trying to access from second program .
    reward if helpful ,
    Regards,
    Ranjita

Maybe you are looking for

  • Old hard drive crashed, cannot get iTunes to find files

    Hi, Please help. Been working on this for weeks and can't get it right. Am at my wit's end: Old hard drive crashed; had new one installed. Tech person was able to find my iTunes on old drive and saved to thumbdrive. Downloaded most recent software an

  • Help required . Disk recovery and OS installation

    Hallo, I'm following a procedure I was given by a Genius at Apple Store. I had an issue with the disk and I formatted and I was trying to install the OS. it went for Internet recovery and it asked me to install Mountain Lion (which I hadn't bought be

  • CS5.1 and Mavericks Incompatibility

    CS5.1 works fine with Mountain Lion, but with Mavericks I get a spinning ball when trying to access the drop down menus.  PS has to be force quit to exit the app.  I have downloaded the Java app that has been mentioned in posts; it does not work in m

  • Multi-channel loudspeakers and headpho

    i have the audigy 2nx and am using the www.alcatech.com bpm pro4 audio software. This software requires either 2 soundcards or one which has multi-channel support. Its basically a mixer - i want to listen to one song through the loudspeakers and anot

  • HT1430 My iPad wont accept my user name or password to connect to my email accounts

    I Cannot get my emails on two aol accounts,it says my user name or password is incorrect but I have not altered it.tried deleting and re installing my email accounts but still no luck,any help would be appreciated tried syncing from my computer too.