Updating the same row in different sessions

Hi,
I've one table application(appl_no varchar2(10), locked_user varchar2(8)) which is used to track which user is logged in at present.
As soon as any user is logged in to the system via front end, the user ID is populated to locked_user column so that no other user cannot access the same appl_no. As soon as the user exits from the front end, the locked_user is updated to null.
We've experiencing a strange behaviour in our system where one user exits from front end and at the same time(previous transaction is not committed) the same user ID opens the same application in another session, but the session session doesn't gets hanged(waiting for the lock to be released) and tries to update the same row which was locked by first user's session. We come to know this thing when the trigger on the table gets fired in both sessoins.
Now I want to know if there is any locking machanism in Oracle where the same row can be updated in 2 different sessons one after another when the first session has not committed its changes?
Thanks
Deepak

And obviously no two sessions can update the same record at the same time
Yes I know that and I tried the same thing by myself on 2 different sql sessions which is not happening, but this is happening when the same is being done from front end(Power Builder based application).
Just wanted to check is there any possibility where this can be possible?
Thanks
Deepak

Similar Messages

  • Insert a field and update the same row.

    Hi,
    I am inserting a value in a row.
    And later within a cursor loop I am trying to update the same row. But it is not working....
    CREATE OR REPLACE procedure Del_Note_stage
    Is
    v_delNote Delivery_Note.Delivery_Note_id%type;
    Cursor C1 is Select Heading_Name,File_Data from Sqlload_Stage;
    Begin
    dbms_output.put_line('i am here a ');
    Select Delivery_Note_Id_Seq.nextval into v_delNote from dual;
    Insert into DELIVERY_NOTE_STAGING(Delivery_Note_ID,LUT,LUB,PROCESSED) Values(v_delNote,sysdate,'Config','N');
    commit;
    dbms_output.put_line('i am here b'||v_delNote);
    For sqlload_rec in C1
       Loop
        dbms_output.put_line(sqlload_rec.Heading_Name);
        dbms_output.put_line('Del Note Id is :'||v_delNote);
        update DELIVERY_NOTE_STAGING  set deployed_by='TOM' where delivery_note_id=v_delNote;
    End loop;
    End;

    But it is not working....Why not?
    Please read: http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
    Why are you updating after inserting?
    Just add deployed_by to the insert statement, or use a default value for that column.
    Also you don't need to select your Delivery_Note_Id_Seq.nextval from dual, just use it in your insert statement.
    Something like:
    Insert into DELIVERY_NOTE_STAGING(Delivery_Note_ID,LUT,LUB,PROCESSED,deployed_by )
    Values( Delivery_Note_Id_Seq.nextval,sysdate,'Config','N', 'TOM' /*or USER*/);

  • Using a custom itemrenderer in datagrid to update value in the same row but different column/cell

    Here's what I have so far.  I have one datagrid (dg1) with enable drag and another datagrid (dg2) with dropenabled.  Column3 (col3) of dg2 also has a custom intemrenderer that's just a hslider.
    When an item from dg1 is dropped on dg2, a custom popup appears that asks you to use the slider in the popup to set a stress level.  Click ok and dg2 is populated with dg1's item as well as the value you selected from the popup window.  I was also setting a sliderTemp variable that was bound to the itemrender slider to set it but that's obviously causing issues as well where all the itemrenderer sliders will change to the latest value and I don't want that.
    What is needed from this setup is when you click ok from the popup window, the value you choose from the slider goes into dg2 (that's working) AND the intemrenderer slider needs to be set to that value as well.  Then, if you used the intemrenderer slider you can change the numeric value in the adjacent column (col2).   I just dont know how to hook up the itemrenderer slider to correspond with that numeric value (thatds be in col2 on that row);
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600"
                        xmlns:viewStackEffects="org.efflex.mx.viewStackEffects.*" backgroundColor="#FFFFFF" creationComplete="init(event)"
                        xmlns:components="components.*" xmlns:local="*">
         <mx:Script>
              <![CDATA[
                   import mx.binding.utils.ChangeWatcher;
                   import mx.collections.ArrayCollection;
                   import mx.controls.Alert;
                   import mx.controls.TextInput;
                   import mx.core.DragSource;
                   import mx.core.IUIComponent;
                   import mx.events.CloseEvent;
                   import mx.events.DataGridEvent;
                   import mx.events.DragEvent;
                   import mx.events.FlexEvent;
                   import mx.events.ListEvent;
                   import mx.events.SliderEvent;
                   import mx.events.SliderEventClickTarget;
                   import mx.managers.DragManager;
                   import mx.managers.PopUpManager;
                   import mx.utils.ObjectUtil;
                   [Bindable]private var myDP1:ArrayCollection;
                   [Bindable]private var myDP2:ArrayCollection;
                   [Bindable]public var temp:String;
                   [Bindable]public var slideTemp:Number;
                   private var win:Dialog;     
                   protected function init(event:FlexEvent):void{
                        myDP1 = new ArrayCollection([{col1:'Separation from friends and family due to deployment'},{col1:'Combat'},{col1:'Divorce'},{col1:'Marriage'},
                             {col1:'Loss of job'},{col1:'Death of a comrade'},{col1:'Retirement'},{col1:'Pregnancey'},
                             {col1:'Becoming a parent'},{col1:'Injury from an attack'},{col1:'Death of a loved one'},{col1:'Marital separation'},
                             {col1:'Unwanted sexual experience'},{col1:'Other personal injury or illness'}])
                        myDP2 = new ArrayCollection()
                   protected function button1_clickHandler(event:MouseEvent):void
                        event.preventDefault();
                        if(txt.text != "")
                             Alert.yesLabel = "ok";                    
                             Alert.show("", "Enter Stress Level", 3, this,txtClickHandler);
                   private function image_dragEnter(evt:DragEvent):void {
                        var obj:IUIComponent = IUIComponent(evt.currentTarget);
                        DragManager.acceptDragDrop(obj);
                   private function image_dragDrop(evt:DragEvent):void {
                        var item:Object = dg2.selectedItem;                    
                        var idx:int = myDP2.getItemIndex(item);
                        myDP2.removeItemAt(idx);
                   protected function dg1_changeHandler(event:ListEvent):void
                        temp=event.itemRenderer.data.col1;     
                   protected function dg2_dragDropHandler(event:DragEvent):void
                        event.preventDefault();                         
                        dg2.hideDropFeedback(event as DragEvent)
                        var win:Dialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;
                        win.btn.addEventListener(MouseEvent.CLICK, addIt);
                        PopUpManager.centerPopUp(win);                              
                        win.mySlide.addEventListener(Event.CHANGE, slideIt);
                   private function txtClickHandler(event:CloseEvent):void {
                        trace("alert");
                        if (event.detail==Alert.YES){
                             myDP2.addItem({label:temp});
                   private function addIt(event:MouseEvent):void{                    
                        myDP2.addItem({col1:temp, col2:slideTemp})
                   private function slideIt(event:SliderEvent):void{                    
                        slideTemp = event.target.value;               
              ]]>
         </mx:Script>
                   <mx:Panel x="10" y="10" width="906" height="481" layout="absolute">
                        <mx:Image x="812" y="367" source="assets/woofie.png" width="64" height="64" dragDrop="image_dragDrop(event);" dragEnter="image_dragEnter(event);"/>
                        <mx:DataGrid x="14" y="81" width="307" height="251" dragEnabled="true" id="dg1" dataProvider="{myDP1}" wordWrap="true" variableRowHeight="true" change="dg1_changeHandler(event)">
                             <mx:columns>
                                  <mx:DataGridColumn headerText="Examples of Life Events" dataField="col1"/>
                             </mx:columns>
                        </mx:DataGrid>
                        <mx:DataGrid x="329" y="81" height="351" width="475" dragEnabled="true" dropEnabled="true" id="dg2"
                                        wordWrap="true" variableRowHeight="true" dataProvider="{myDP2}" editable="true"
                                        dragDrop="dg2_dragDropHandler(event)"  rowHeight="50" verticalGridLines="false" horizontalGridLines="true" >
                             <mx:columns>
                                  <mx:DataGridColumn headerText="Stressor" dataField="col1" width="300" wordWrap="true" editable="false">
                                  </mx:DataGridColumn>
                                  <mx:DataGridColumn headerText="Stress Level" dataField="col2" width="82" editable="false"/>
                                  <mx:DataGridColumn headerText="Indicator" dataField="col3" width="175" paddingLeft="0" paddingRight="0" wordWrap="true" editable="false">
                                       <mx:itemRenderer>
                                            <mx:Component>
                                                 <components:Compslide/>
                                            </mx:Component>
                                       </mx:itemRenderer>
                                  </mx:DataGridColumn>
                             </mx:columns>
                        </mx:DataGrid>                    
                        <mx:Text x="14" y="10" text="The first category of underlying stressors is called Life Events. The list includes both positive and negative changes that individuals experience. Both can be stressful. For example, becoming a parent is usually viewed as a positive thing, but it also involves many new responsibilities that can cause stress. " width="581" height="73" fontSize="12"/>
                        <mx:TextInput x="10" y="380" width="311" id="txt"/>
                        <mx:Text x="10" y="335" text="Add events to your list that are not represented in the example list.  Type and click &quot;Add to List&quot;&#xa;" width="311" height="51" fontSize="12"/>
                        <mx:Button x="234" y="410" label="Add to List" click="button1_clickHandler(event)"/>
                   </mx:Panel>     
    </mx:Application>

    how do i go about doing that?  do i put a change event function in the itemrenderer?  and how would i eventually reference data.col2?

  • Two Infopath forms to submit or update the same sharepoint list

    Hi, I'm building a request SharePoint site so users can submit a request from a simplified InfoPath form (with only 5 out of 10 fields), but support personnel can open the form and then see all 10 fields.  For the list view, I know I can create custom
    views when user's see the list.  But when they open an item, I only want them to see the fields they entered and not the other fields the support personnel can see.  So I guess my question is: can I create two InfoPath forms to update one list or
    can I create an InfoPath form that has two views so one view suppresses fields and the other does not (based on permissions perhaps).

    Hi Darby,
    I would suggest creating two views, instead of two forms. Views can be shown/hidden based on the logged in users, takes few rules to configure based on the logged in users. you can also explore web service to get the users from groups to show/hide based
    on the user group, little overhead but give more control due to the fact of one single form.
    Two forms will be bit complex, if you want to update the same rows of information.
    here are some references -
    http://blogs.technet.com/b/anneste/archive/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010.aspx
    http://claytoncobb.wordpress.com/2009/06/21/userprofileservice-extended/
    http://sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=daba3a3b%2Dc338%2D41d8%2Dbf52%2Dcd897d000cf3&ID=80&Web=dbb90e85%2Db54c%2D49f4%2D8e97%2D6d8258116ca0
    http://office.microsoft.com/en-us/infopath-help/add-delete-and-switch-views-pages-in-a-form-HA101732801.aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • ADF 11g Partial Triggers Row Column Update By Column in the Same Row

    Hi.
    I have a situation whereby I have a checkbox in a table row, which has an eventchangelistener, which upon activation, trys to update another column in the same row. I can not get this to work through partial triggers, even though I have set up my ids up correctly. The row though can be updated by a command button outside of the table using the same coding techniques, but I need it updated via the checkbox.
    Is there a limitation in updating a column within a row, from another row column's event change listener.
    Thanks.

    Updating the other rows from the checkbox works fine for me. Here is what I did.
    I DnD Emp table with a new column that says if the emp is new hire. If the checkbox is checked, I set Firstname and Lastname for that row as NewHire. I have partial triggers on Firstname and Lastname columns to update whenever checkbox is checked/unchecked and autosubmit on checkbox to true. Hope this helps.
    Try adding column selection property to single and see if it helps.
    Edited by: asatyana on Jan 16, 2012 12:48 AM
    Edited by: asatyana on Jan 16, 2012 12:49 AM

  • Multiple users updates the same data - RowInconsistentException

    Hi,
    I'm using JDeveloper 11.1.2.1
    Locking mode: optimistic
    Scenario:
    - Have 2 users (user 1 & user 2) running application x
    - Both users updates the same record
    - user 1 hits save first (and hence no error)
    - user 2 hits save after user 1, and gets RowInconsistentException
    I have managed to trap the exception in the EntityImpl class:
    public void lock() {
    try {
    super.lock();
    catch (RowInconsistentException ex) {
    this.refresh(REFRESH_UNDO_CHANGES);
    super.lock();
    But what this does is that it just refreshed the entities and removed user 2's work without notification, which isn't acceptable.
    Instead of this, is it possible to display an error message in user 2's UI (instead of the stack error) , refresh the entities, but keep user's 2 work, and possibly recommit?
    Thank You
    Regards,
    Andi

    Andi,
    , is it possible to display an error message in user 2's UI (instead of the stack error)You can customise the error handling, yes, to display a different message if you like (check out the Fusion Developer's Guide to find out how)
    refresh the entities, but keep user's 2 workNot sure what you mean there
    By default (at least it used to be this way, haven't checked recently), if you commit again after receiving the "row inconsistent" error, it will save user 2's changes (potentially overwriting user 1's changes)
    John

  • How to find out, who locked the same row

    Dears,
    I have a problem,
    sometimes our user complain that, when he tyring to make a transaction to a specific customer's Account
    its says 'Some other user access the same account, keep trying...' (like this).
    and in this response I just kill that user's session. then he can make the transaction by reconnecting.
    sometimes my solution(killing the session) can not slove this problem.it stayed even 5/6 hours long.
    in this time,i cannot find any bloking session or such a long waiting session.
    In this Scenario..
    I need to find out who(SID,SERIAL#,USERNAME) locked the same ROW (not table).
    There are many users who are locking different rows of the same table at the
    same time. I need to find the one who locked my row.
    is it possible to find out, who locked the specific customer's Account ?
    I am trying to find out by the following query but failed.
    SELECT s.SID, serial#, machine, osuser, terminal, b.object_name,
    row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#,
    DBMS_ROWID.rowid_create (1,
    row_wait_obj#,
    row_wait_file#,
    row_wait_block#,
    row_wait_row#
    ) rowidd
    FROM v$session s, dba_objects b
    WHERE s.row_wait_obj# = b.object_id
    SELECT *
    FROM (SELECT s.SID, serial#, machine, osuser, terminal, b.object_name,
    row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#,
    DBMS_ROWID.rowid_create (1,
    row_wait_obj#,
    row_wait_file#,
    row_wait_block#,
    row_wait_row#
    ) rowidd
    FROM v$session s, dba_objects b
    WHERE s.row_wait_obj# = b.object_id)
    WHERE rowidd IN (SELECT ROWID
    FROM account_mas
    WHERE branch = '999' AND accout_no = '009990215454')
    please help me...
    My Database version- 10.2.0.4, windows
    Regards
    Halim
    Edited by: Abdul Halim on Oct 26, 2009 2:43 AM

    Just check with this query, find the lock and kill the session.
    select b.session_id ,a.SERIAL#, a.username "Blocker Details"
    from v$session a,dba_lock b
    where b.session_id = a.sid
    and b.blocking_others = 'Blocking';
    Regards
    Asif kabir

  • Insert then update on same row in bean Transaction leads to deadlock

    <b>Setup Details</b>
    Hibernate version: 3.1.2
    EJB version: 2.0
    Name and version of the database : MS SQL Server 2000
    Datasource implmentation class being used : com.sap.nwmss.jdbcx.sqlserver.SQLServerDataSource
    We are using SAP NetWeaver Application Server 6.0 and Hibernate 3.1.2 in our application. We have StalessSessionBeans which use Hibernate to interact with the database. We are running into a situation where the application goes into a hang state when the following flow is bein executed:
    //transaction attribute = "Required"
    beanMethod() {
    myObj = new MyObj();
    myObj.setSomeValue();
    session = SessionFactory.openSession();
    //id is auto generated by database
    id = session.insert(myObj);
    //retrieve the recently inserted obj
    myUpdatedObj = session.load(id);
    //modify the myUpdatedObj
    myUpdatedObj.modifySomeValue();
    //update using hibernate session
    session.update(myUpdatedObj);
    //return from method 
    Here's the flow:
    1) In a CMT stateless session bean, there's a method which has transaction atrribute as "Required"
    2) This method creates a new object and inserts it
    3) Then loads this saved object and modifies some values in it
    4) Then invokes the update method on the session to update this modified object in the database.
    Note: We have enabled auto flush on transaction in the hibernate configuration file.
    And here's what we are observing:
    - The insert obtains a lock on the row as part of the transaction
    - When the update is called on the same row as part of the auto flush, the update never completes. The update statement is unable to obtain a lock on the same row.
    Here is some additional info:
    - We have set :
    session.connection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
    hibernate.cfg.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
                "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
       <session-factory>
          <property name="hibernate.jndi.class">
             com.sap.engine.services.jndi.InitialContextFactoryImpl
          </property>
          <property name="hibernate.session_factory_name">
             HibernateSessionFactory
          </property>
          <property name="hibernate.transaction.factory_class">
             org.hibernate.transaction.JTATransactionFactory
          </property>
          <property name="hibernate.connection.datasource">jdbc/SQLPool1</property>
          <property name="hibernate.connection.pool_size">25</property>
          <property name="show_sql">true</property>
          <property name="hibernate.connection.isolation">1</property>
          <property name="hibernate.prepare_sql">true</property>
          <property name="hibernate.statement_cache.size">10000</property>
          <!--property name="hibernate.jdbc.use_scrollable_resultset">true</property-->
          <property name="transaction.manager_lookup_class">
             com.tdemand.server.util.hibernate.SAPWebASTransactionManagerLookup
          </property>
          <property name="hibernate.jdbc.use_get_generated_keys">
                   false
          </property>
          <property name="hibernate.transaction.flush_before_completion">true</property>
          <property name="hibernate.jdbc.batch_size">1000</property>
          <property name="hibernate.cache.use_second_level_cache">false</property>
       </session-factory>
    </hibernate-configuration>
    Any clue why the update query is having problem in completing, even though update and insert are being called from the same bean method as part of a transaction?
    Here's the log:
    2006-11-01 22:10:00,310 INFO [com.tdemand.server.planning.ejbs.ForecastPlanningSessionBean] - Starting save
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.DefaultSaveOrUpdateEventListener] - saving transient instance
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.DefaultSaveOrUpdateEventListener] - saving transient instance
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - saving [com.tdemand.generated.pojo.TdForecastPlan#<null>]
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - saving [com.tdemand.generated.pojo.TdForecastPlan#<null>]
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - executing insertions
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - executing insertions
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] - Inserting entity: com.tdemand.generated.pojo.TdForecastPlan (native id)
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] - Inserting entity: com.tdemand.generated.pojo.TdForecastPlan (native id)
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.SQL] - insert into trd0nedbo.TD_FORECAST_PLAN (ORGANIZATION_TBL_ID, USER_TBL_ID, PLAN_NAME, IS_ACTIVE, PLAN_TYPE, TIMECREATED, TIMEUPDATED, START_TIME, END_TIME, HORIZON, HORIZON_UOM, REVIEW_FREQ, ACCU_THRESHOLD, REVIEW_FREQ_UOM, FORECAST_METRIC, BASE_FORECAST, PRECISION_FORECAST, ADJUSTED_FORECAST, ORG_ID, CRON_TRIG_NAME) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) select scope_identity()
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.SQL] - insert into trd0nedbo.TD_FORECAST_PLAN (ORGANIZATION_TBL_ID, USER_TBL_ID, PLAN_NAME, IS_ACTIVE, PLAN_TYPE, TIMECREATED, TIMEUPDATED, START_TIME, END_TIME, HORIZON, HORIZON_UOM, REVIEW_FREQ, ACCU_THRESHOLD, REVIEW_FREQ_UOM, FORECAST_METRIC, BASE_FORECAST, PRECISION_FORECAST, ADJUSTED_FORECAST, ORG_ID, CRON_TRIG_NAME) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) select scope_identity()
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] - Dehydrating entity: [com.tdemand.generated.pojo.TdForecastPlan#<null>]
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] - Dehydrating entity: [com.tdemand.generated.pojo.TdForecastPlan#<null>]
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.LongType] - binding '6' to parameter: 1
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.LongType] - binding '6' to parameter: 1
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.LongType] - binding '1' to parameter: 2
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.LongType] - binding '1' to parameter: 2
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'jaikiranpai' to parameter: 3
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'jaikiranpai' to parameter: 3
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'Y' to parameter: 4
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'Y' to parameter: 4
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'RetailDCOrderForecast' to parameter: 5
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'RetailDCOrderForecast' to parameter: 5
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding '2006-11-01 22:10:00' to parameter: 6
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding '2006-11-01 22:10:00' to parameter: 6
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 7
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 7
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding '2006-11-01 22:10:00' to parameter: 8
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding '2006-11-01 22:10:00' to parameter: 8
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 9
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 9
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '14' to parameter: 10
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '14' to parameter: 10
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'DAY' to parameter: 11
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'DAY' to parameter: 11
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '7' to parameter: 12
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '7' to parameter: 12
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '0' to parameter: 13
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '0' to parameter: 13
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'DAY' to parameter: 14
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'DAY' to parameter: 14
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'MAPE' to parameter: 15
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'MAPE' to parameter: 15
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 16
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 16
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 17
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 17
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 18
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 18
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding null to parameter: 19
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding null to parameter: 19
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 20
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 20
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] - Natively generated identity: 103
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] - Natively generated identity: 103
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement

    "insert into aa values ('1', '2', '3','4','5',6,7);
    if sql%rowcount <> 1 then
    RAISE_APPLICATION_ERROR(-20999, 'insert aa err');
    END IF;
    /* skip some code
    update aa set dept_code = '3' where fee_month = '1';
    if sql%rowcount <> 1 then"
    Is Dept_Code the 2nd Column in the table aa. If so then
    why update the table ?
    Why not Insert Into aa Values ('1', '3', '3' ......);
    Have a look at the sample script which is doing Insert followed by updating the same table using the ROWID.
    Test Db>desc temp;
    Name Null? Type
    COL1 VARCHAR2(10)
    COL2 VARCHAR2(10)
    COL3 VARCHAR2(10)
    COL4 VARCHAR2(10)
    ID NUMBER
    Test Db>select * from temp;
    no rows selected
    Test Db>get t1
    1 Set ServerOutput On Size 999999;
    2 Declare
    3 lRow Varchar2(50);
    4 Begin
    5 Insert Into Temp (Col1, Col2, Col3, Col4, Id)
    6 Values ('A', 'B', 'C', 'D', 100)
    7 RETURNING RowId Into lRow;
    8 Dbms_Output.Put_Line ('RowId = ' || lRow);
    9 Update Temp Set col2 = 'B1'
    10 Where RowId = lRow;
    11 Dbms_Output.Put_Line ('Row Updated');
    12* End;
    13 /
    Test Db>@t1
    RowId = AAAKsqAAJAAAEbsAAG
    Row Updated
    PL/SQL procedure successfully completed.
    Test Db>select * from temp;
    COL1 COL2 COL3 COL4 ID
    A B1 C D 100
    -- Shailender Mehta --

  • Is there a way to add a column after a filled DataTable from SQL with the same rows?

    My problem is that not to add rows like filled by SQLDataAdapter at the same row in DataGridView. How to make that? I showed below the details with my code also a screen shot, which shows the rows differences from the origin one.
    I don't want to add an expression as column behave in my sql script to get what I need with query result. I don't want to obtain that way.
    using (SqlConnection c = new SqlConnection(ConnStrMSSQL))
    c.Open();
    // 2
    // Create new DataAdapter
    using (SqlDataAdapter a = new SqlDataAdapter("SELECT SIPNO, SERINO, TARIH FROM SNOHAREKETLER WHERE Cast(TARIH as DATE) BETWEEN '2015/03/20' AND '2015/03/20' AND (TEZNO = 'T23' OR TEZNO = 'T31') AND CIKTI is null", c))
    // 3
    // Use DataAdapter to fill DataTable
    DataTable t = new DataTable();
    a.Fill(t);
    t.Columns.Add("MyColumn", typeof(string));
    DataRow workRow;
    int iGetCount = t.Rows.Count;
    for (int i = 0; i <= iGetCount - 1; i++)
    workRow = t.NewRow();
    workRow["MyColumn"] = i;
    t.Rows.Add(workRow);
    dataGridView1.DataSource = t;

    The extra column isn't applied to only certain rows.  The columns of a table identify what data each row will contain.  Hence adding a column to the table automatically adds them to the rows.  What you're seeing is that all the initial rows
    aren't being assigned a value so they retain their default value of null.  Later you enumerate the rows of the existing table and call AddRow which adds new rows.  This isn't adding columns, but rows.
    To generate values for the existing rows you should ideally simply pass the data back from the database.  DT computed columns can be difficult to set up as it is limited to what it can do.  If you want to use a computed column on the Datatable
    itself then define the column as a computed column and every row will calculate its own value.
    DataTable data = GetData();
    //Add elapsed time column
    var col = new DataColumn("ElapsedTime", typeof(TimeSpan), "expr");
    data.Columns.Add(col);
    dataGridView1.DataSource = data;
    The issue you will run into however is that calculating a diff on DateTime doesn't work in a computed column as the expression doesn't support the necessary functions.  You can google for how people solved this if you are interested in alternatives. 
    Most people just tend to add the column and then hook into the various change events to update the value as needed.

  • Radio group in classic report based on another column on the same row.

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Application Express 4.1.0.00.32
    How can I have a radio group column based on an LOV utilizing another column on the same row of the report?
    For example: what if I had a survey application and depending on the likert scale that was assigned to the question there would be different possible answer choices:
    Question 1 on row 1 of the report: The class instructor was friendly?
    Likert scale choice is Agreement.
    Choices on Radio Group: Strongly Agree, Agree, Undecided, Strongly Disagree
    Question 2 on row 2 of the report: The class offered good materials?
    Likert scale choice is Quality.
    Choices on Radio Group: Excellent, Below Average, Average, Above Average, Excellent
    The radio group can change per row depending on the Likert scale assigned to the question which is assigned to a different column on the row.
    Can LOV utilize the column? :
    SELECT scale_text
    FROM scale_choices
    WHERE scale_category_choice_id = 2 <<= this would be the Likert scale identifier
    ORDER
    BY display_order

    Here is the answer:
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
    p_idx IN NUMBER,
    p_value IN VARCHAR2 DEFAULT NULL,
    p_query IN VARCHAR2,
    p_attributes IN VARCHAR2 DEFAULT NULL,
    p_show_null IN VARCHAR2 DEFAULT 'YES',
    p_null_value IN VARCHAR2 DEFAULT '%NULL%',
    p_null_text IN VARCHAR2 DEFAULT '%',
    p_item_id IN VARCHAR2 DEFAULT NULL,
    p_item_label IN VARCHAR2 DEFAULT NULL,
    p_show_extra IN VARCHAR2 DEFAULT 'YES')
    RETURN VARCHAR2;

  • 1 app, 3 devices, 1 iCloud - how can I run the same game on different devices?

    My wife and I share one iTunes account and one iCloud account for 2 iPhone 5's and an iPad.  Our home laptop is a PC running windows 7.  We are not able to both play the same game (specifically Carcassone) at the same time on different devices which is frustrating, how can I make this happen?  Do I need two separate accounts?  Can I have two accounts with a PC?  We don't want to sacrifice the photostream to get it though.
    Thank you,
    Jacob

    Go to iTunea>Preferences>Devices and see if there is a backupright at the time you did the update. Then try restoring from that backup. If the apps are in your iTunes library, any app data will be restored to the iPod.
    When restoring from an iOS 4 (or later) backup, if the device had a passcode set, iTunes will ask if you want to set a passcode (and remind you that you had protected your device with a passcode). iTunes will not ask you to set a passcode when restoring from iOS 3.x and prior backups.
    Therefore, remembe the passcode that you enter this time.
    It appears that if you restore from a backup, that backup is not subseqyently overwritten by the next backup.

  • Multiple instances of the same bean class in session?

    I�m trying to think of a way to have multiple instances of the same bean class in session scope using JSF. For example, let�s say that I have two <h:dataTable>s on the same page. They both use the backing bean called genericBean. Now, the content for genericBean will be different for each <h:dataTable>. In fact, the data source that backs genericBean is not known until runtime. It could be a database, web service, etc.
    What I would like is for when JSF needs access genericBean instead of looking for the value with key �genericBean� in the session map it looks for �genericBean_[some runtime ID]�. I could specify this id in EL on a custom component, as a request parameter or whatever.
    I think that I need the bean to be in session scope because the tables are complex and I want them to be editable.
    I have some ideas about how I can do this but I was wondering if someone has already solved this problem or if there is a standard way to do this using tools like Shale, etc.
    Thanks,
    Randy

    Well, I came up with an interesting solution to this so I thought that I would post it here.
    I have a page that looks like this.
    <html>
    <head>
    <title>My Page</title>
    </head>
    <body>
    <f:view>
    <f:subview id="component1">
    <jsp:include page="component.jsp">
    <jsp:param name="id" value="a" />
    </jsp:include>
    </f:subview>
    <hr>
    <f:subview id="component2">
    <jsp:include page="component.jsp">
    <jsp:param name="id" value="b" />
    </jsp:include>
    </f:subview>
    </f:view>
    </body>
    </html>
    And component.jsp looke like this.
    <f:verbatim>
    <p>
    <h1>Component
    </f:verbatim>
    <h:outputText value=" #{param.id}" />
    <f:verbatim>
    </h1>
    </p>
    </f:verbatim>
    <h:form>
    <h:outputText value="#{component.id}" />
    <h:outputText value="#{component.value}" />
    <h:commandButton value="increment" action="#{component.increment}" />
    <h:commandButton value="decrement" action="#{component.decrement}" />
    <f:verbatim>
    <input type="hidden" name="id"
    value="</f:verbatim><h:outputText value="#{param.id}"/><f:verbatim>" />
    </f:verbatim>
    </h:form>
    The idea is that I want component.jsp to be initialized differently based on the id param. The component managed bean is configured to be in session scope but I want the component instance for id a and id b to be different instances in session scope. Therefore, I added a custom variable resolver to handle this.
    public Object resolveVariable(FacesContext context, String name) {
    // This id will be different for the different subviews.
    HttpServletRequest request = (HttpServletRequest) context.getExternalContext() .getRequest();
    String id = request.getParameter("id");
    // If there is an id in the request then check if this is a bean that can have multiple
    // instances in session scope.
    if ((id != null) && (id.length() > 0)) {
    ExternalContext ec = context.getExternalContext();
    // Build the new name for the key of this bean
    String newName = name + "_" + id;
    Object value = null;
    // See if the bean instance already esists.
    if ((null == (value = ec.getRequestMap().get(newName))) &&
    (null == (value = ec.getSessionMap().get(newName))) &&
    (null == (value = ec.getApplicationMap().get(newName)))) {
         // We could not find the bean instance in scope so create the bean
         // using the standard variable resolver.
    value = original.resolveVariable(context, name);
    // Now check if the bean implements that page component interface. If it is
    // a page component then we want to rename the key to access this bean so
    // that the instance is only used when the id is provided in the request.
    // For example, if there are two components (a and b) we will have in session scope
    // component_a and component_b. The will each point to a unique instance of the
    // Component bean class.
    if (value instanceof PageComponent) {
    // Try to get the value again
    if (null != (value = ec.getRequestMap().get(name))) {
         // Initialize the bean using the id
    ((PageComponent) value).initInstance(id);
    ec.getRequestMap().remove(name);
    ec.getRequestMap().put(newName, value);
    } else if (null != (value = ec.getSessionMap().get(name))) {
    ((PageComponent) value).initInstance(id);
    ec.getSessionMap().remove(name);
    ec.getSessionMap().put(newName, value);
    } else if (null != (value = ec.getApplicationMap().get(name))) {
    ((PageComponent) value).initInstance(id);
    ec.getApplicationMap().remove(name);
    ec.getApplicationMap().put(newName, value);
    return value;
    return original.resolveVariable(context, name);
    }

  • How to use the same element in different photoshop files?

    It occurs to me often that I use the same element in different photoshop files, a header or footer shown in the example below. So when the footer changes in one document, I need to change this footer in every other single document.
    Is there a possibility to use some kind of template, one single document,  that can be placed in different files , which is still editable afterwards?
    Thanks in advance.
    I'm using Photoshop CS6

    In a single document you can have several pages and these pages may have headers and footers that share smart objects.  If you replace the contents of the an embedded smart object on one page page that is shared on an other page the pages you will see both pages contents are changed. For they share the common object.   It is also possibly to have independent smart object layers. It depends how you create the layers in the single document.
    Example one sharing a smart object hi-light a smart object layer and use menu layer>Duplicate Layer... This will create a second smart object layer that share a common smart object. Each layer has is own associated transform. Do it again and you will have three layers the share a common smart object. So you can use each layer associated transform to position and size the layers contents. Make a picture package for example. When you hi-light any of the three smart layers and you use menu Layer>Smart Objects>Replace Contents... all three layers contents will be replace with the new smart object.  Care must be taken to replace the smart object with an identical size object for only the object is replaced the three associated transform for the three layers are not replaced or changed.
    Example two independent smart objects  hi-light a smart object layer and use menu layer>Smart Objects>New Smart Object via Copy.  This will  create a second smart object layer that has it own embedded smart object copy.  Do it again and you will have three all have independent embedded smart object that are identical.  However they do not have to remain identical.  For example if the first smart object layer was created by using ACR to open a RAW file as a smart object layer the embedded object is a copy of the raw file and its associated RAW conversion settings.  Double clicking on one of the smart object layers and you will see ACR open on its embedded RAW file with the embedded RAW conversion setting.  Changing these settings will update the layer smart object content with new ACR setting and pixel when you click OK in ACR. Repeat for the third and you will find you have three different raw conversions in Photoshop you can mask and blend together to bring out detail.
    I think what your missing is that a smart object contains a copy of the original object.  Changing the original after creating a smart object layer in document will not effect the smart object layer at all. Its independant from the original having a copy of the original. Only changes to the smart object layer and its embedded smart object effect smart object layers.

  • How to generate a value to field in a row based on another two fields in the same row ???

    I have a quantity and unit price and there is also a field in the same row called total price. I want to get the value automatically of total price from multiplying quantity and unit price.

    Here you go:
    page code
                            <af:panelGroupLayout id="pgl2" layout="horizontal" styleClass="AFStretchWidth">
                                <af:inputText label="Quantity" id="quantity" value="#{bindings.quantity1.inputValue}" autoSubmit="true"
                                              valueChangeListener="#{SetItemBean.valueChangeListenerItem}"/>
                                <af:spacer width="10" height="10" id="s1"/>
                                <af:inputText label="Price" id="price" value="#{bindings.price1.inputValue}" autoSubmit="true"
                                              valueChangeListener="#{SetItemBean.valueChangeListenerItem}"/>
                                <af:spacer width="10" height="10" id="s2"/>
                                <af:inputText label="Sum" id="total" value="#{bindings.total1.inputValue}" partialTriggers="quantity price" readOnly="true"/>
                            </af:panelGroupLayout>
    page bindings
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="12.1.2.66.68" id="SetItemPageDef" Package="de.hahn.blogtest12c.view.pageDefs">
      <parameters/>
      <executables>
        <variableIterator id="variables">
          <variable Name="quantity" Type="java.lang.Number"/>
          <variable Name="price" Type="java.lang.Number"/>
          <variable Name="total" Type="java.lang.Number"/>
        </variableIterator>
      </executables>
      <bindings>
        <attributeValues IterBinding="variables" id="quantity1">
          <AttrNames>
            <Item Value="quantity"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="variables" id="price1">
          <AttrNames>
            <Item Value="price"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="variables" id="total1">
          <AttrNames>
            <Item Value="total"/>
          </AttrNames>
        </attributeValues>
      </bindings>
    </pageDefinition>
    and bean code
        public void valueChangeListenerItem(ValueChangeEvent valueChangeEvent) {
            String comp = valueChangeEvent.getComponent().getId();
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("quantity1");
            Number q = (Number) attr.getInputValue();
            if (q == null)
                q = 0;
            attr = (AttributeBinding) bindings.getControlBinding("price1");
            Number p = (Number) attr.getInputValue();
            if (p == null)
                p = 0;
            if ("price".equals(comp)) {
                p = (Number) valueChangeEvent.getNewValue();
            } else {
                q = (Number) valueChangeEvent.getNewValue();
            // set new value
            attr = (AttributeBinding) bindings.getControlBinding("total1");
            Number t = q.doubleValue() * p.doubleValue();
            attr.setInputValue(t);
            // update Total
            FacesContext facesCtx = FacesContext.getCurrentInstance();
            UIComponent ui = facesCtx.getViewRoot().findComponent("total");
            if (ui != null) {
                // PPR refresh a jsf component
                AdfFacesContext.getCurrentInstance().addPartialTarget(ui);
    Timo

  • Multiple updates to same row

    Hi experts,
    I still cant figure out how oracle handles multiple updates to the same row. For instance I have 3 update statements:
    update supplier set supp_type = 'k' where supp_code = '1';
    update supplier set supp_type = 'j' where supp_code = '1';
    update supplier set supp_type = 'm' where supp_code = '1';
    I keep getting the final result to be supp_type = 'k' where it should actually be 'm', but when i execute the mapping it shows 3 update operations, which baffled me as to how oracle handles simultaneous updates to same row. I even tried disabling parallel dml on the table object, but am unsure whether this actually helps. I try putting a sorter operator and then a key lookup operator after the sorter operator in my mapping to compare the supp_code field in the sorter with the target table's supp_code field to retrieve the relevant row to update, but instead of 3 update operations, it now updates all supp_type in all my records to NULL. Can anyone explain to me how i should go about dealing with this?

    Hi experts,
    I just took a look at the code section generated for the key lookup operator named SUPPLIER_WH_SURRKEY01 and I feel something is wrong with the generated code. I have pasted the code section on the key lookup operator below.
    ORDER BY
    "SUPPLIER_CV"."RSID$" ASC ) *"SORTER" ON ( ( ( "SUPPLIER_WH_SURRKEY01"."EXPIRATION_DATE" = "SPIDERWEB2"."GET_EXPIRATI_0_EXPIRATI" ) ) AND ( ( "SUPPLIER_WH_SURRKEY01"."SUPPCODE" = "SORTER"."SUPP_CODE$1" ) ) )*
    WHERE
    ( ( "SUPPLIER_WH_SURRKEY01"."SUPPKEY" IS NULL ) OR ( "SUPPLIER_WH_SURRKEY01"."SUPPKEY" = "SUPPLIER_WH_SURRKEY01"."SUPPKEY" ) );
    Can anyone explain to me the codes in bold? I have no clue as to what it means? Furthermore, those bold-ed codes look similar to what I have expected to find in the where clause, except that instead of SUPPLIER_WH_SURRKEY01"."EXPIRATION_DATE" = "SPIDERWEB2"."GET_EXPIRATI_0_EXPIRATI", I expected to find
    SUPPLIER_WH_SURRKEY01"."EXPIRATION_DATE" = '31-dec-4000', because my key lookup operator checks upon a constant with the value '31-dec-4000'. And the constant name is CONSTANT itself, while my mapping's name is SPIDERWEB2(not too sure why the generated code refers to my mapping name instead of my constant)
    Edited by: user8915380 on 17-Mar-2010 00:52

Maybe you are looking for

  • My blackberry tour plays a song whenever I hang up or close the camera

    Not a full song, but about 30 seconds of one. Kind of like a ringtone. Except I haven't downloaded any ringtones or music onto my phone. Also I didn't even know the name of the song until a few days after it started happening, so I really have no ide

  • Problem with a series with multipul books

    Especially within the Science Fiction and Fantasy categories, there are a number of multi-book series. Within the Kindle these books are identified by their position within the series. For example Title, book 2 of 9 for X series. The iBook store give

  • Standard program copy query?

    Hi all, I have copied the standard program pp_pick_list. This standard program consists of 7 include programs. but i cant able to open the include programs. Any clue how to open the include progams ? pl help Regards, sachin 11

  • Restricting FXS ports to internal calls only

    Hi, I have recently intalled Call Manager 8.5.1 with a H323 Gateway. On the gateway, I have a number of FXS ports for lobby phones. Is there a way I can restrict these phones to allow only internal calls only? Do I need to use COR lists like in Call

  • 7,1 was a dream: Media shortcuts/front panel issues

    Hey I have a Dell Inspiron 6400. On the front it have this Media Shortcuts / Frontpanel In iTunes 7.1 they did work. Like, I could minimize iTunes, use other programs and still I could change songs and stuff. But after all the updates on iTunes, this