IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Forms Oracle Discussion :

[FORMS PL/SQL] Select for Update


Sujet :

Forms Oracle

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2004
    Messages
    349
    Détails du profil
    Informations personnelles :
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Décembre 2004
    Messages : 349
    Points : 409
    Points
    409
    Par défaut [FORMS PL/SQL] Select for Update
    Bonjour,
    Lorque je lance une forme à l'adresse :

    une mise à jour est corretement effectuée. Si je lance cette même form depuis mon menu applicatif, mes données ne sont pas mises à jour

    J'ai placé différents messages et dans les 2 cas, je passe au même endroit avec les mêmes valeurs.

    Le problême se situe sur le curseur c_sysreg

    Quel est votre avis ? merci .

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    declare
     
    	t_sysreg_id    system_registry.sysreg_id%type;
     
      CURSOR C_PARENT IS
        SELECT * FROM SYSTEM_REGISTRY
          WHERE SYSREG_ID = :local.selected_node;
     
      R_PARENT SYSTEM_REGISTRY%ROWTYPE;
     
    	cursor c_sysreg is
    	  select 1 from system_registry
    	    where sysreg_id = :leaf_block.sysreg_id
    	    for update of description,sysreg_data
    	    nowait;
     
    	r_sysreg c_sysreg%rowtype;
     
      cursor c_unique(
        p_parent_desc     varchar2,
        p_description     varchar2,
        p_company_code    varchar2,
        p_department_code varchar2,
        p_point_code      varchar2,
        p_user_id         varchar2
      ) is
        select sysreg_id from system_registry
          where upper(parent_desc)              = upper(p_parent_desc)
          and   upper(description)              = upper(p_description)
          and   nvl(upper(company_code),' ')    = nvl(upper(p_company_code),' ')
          and   nvl(upper(department_code),' ') = nvl(upper(p_department_code),' ')
          and   nvl(upper(point_code),' ')      = nvl(upper(p_point_code),' ')
          and   nvl(upper(user_id),' ')         = nvl(upper(p_user_id),' ');
     
      r_unique c_unique%rowtype;
     
    	e_handled	exception;
     
    begin
     
        -- update existing...
        for a in 1..10 loop
        begin
        			message ('open');
            open c_sysreg;
            	message ('open OK');
            exit;
        	exception
        		when others then
        		  if sqlcode = -54 then
        		  	if a = 10 then
        		  		pl_debug.display('Could not lock entry for update');
        		  		raise e_handled;
        		  	end if;
        		  else
       		  		pl_debug.display('SQL error ' || sqlcode || ' trying to lock registry entry');
       		  		raise e_handled;
       		  	end if;
        	end;
        end loop;
        fetch c_sysreg into r_sysreg;
        if c_sysreg%found then
        	message ('c_sysreg%found');
        	message ( :editleaf.description);
       		message (:editleaf.sysreg_data);
        	message (:leaf_block.sysreg_id);
        	begin
        	update system_registry
        	  set description = :editleaf.description,
        	      sysreg_data = :editleaf.sysreg_data
        	  where current of c_sysreg;
     
        	 commit;
        	 message ('commit');
        	exception when others then 
        		message (sqlerrm);
        	end;
        else
        		message ('Error locating registry entry, refresh and retry');
        		message ('Error locating registry entry, refresh and retry');
        	pl_debug.display('Error locating registry entry, refresh and retry');
        end if;
        close c_sysreg;
      -- end if;
     
      standard.commit;
      	message ('Populate_Leaves');
     
      Populate_Leaves;
      	message ('hide_window');
     
     
      hide_window('WIN_EDITLEAF');
      go_block('tree_block');
     
    exception
    	when e_handled then
    	  null;
    	when others then
    	  pl_debug.display('Unexpected SQL error ' || sqlcode || chr(10) || sqlerrm(sqlcode));
    	  if c_sysreg%isopen then
    	  	close c_sysreg;
    	  end if;
    	  if c_parent%isopen then
    	  	close c_parent;
    	  end if;
     
    end;

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2004
    Messages
    349
    Détails du profil
    Informations personnelles :
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Décembre 2004
    Messages : 349
    Points : 409
    Points
    409
    Par défaut
    Subject: Using "Update ... Where Current Of" Sometimes Data Is Not Updated, Using Version 10.1.2.0.2
    Doc ID: Note:369451.1 Type: PROBLEM
    Last Revision Date: 26-JUN-2006 Status: PUBLISHED


    Cause

    The cause of this problem has been identified in Bug 4762734. It is caused by rowid sometimes not obtained correctly. In the test case for the bug this could happen for the first two rows of a cursor in a form that was opened in a separate session.

    This is fixed in future version 10.1.2.2

    Please note a similar issue exists in Reports, it is identified in Bug 5099183.
    Solution

    While awaiting the availability of Forms 10.1.2.2 one solution is to apply the Patch 4762734 on top of your 10.1.2.0.2 - if it is available for your platform.
    Regarding the reports issue, while awaiting the availability of Reports 10.1.2.2, similarly, a Patch 5099183 is available on top of your 10.1.2.0.2 .

  3. #3
    Membre expert

    Homme Profil pro
    Chef de projet en SSII
    Inscrit en
    Janvier 2004
    Messages
    2 862
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Chef de projet en SSII
    Secteur : Conseil

    Informations forums :
    Inscription : Janvier 2004
    Messages : 2 862
    Points : 3 609
    Points
    3 609
    Par défaut
    Merci de nous avoir fait partager la solution

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2004
    Messages
    349
    Détails du profil
    Informations personnelles :
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Décembre 2004
    Messages : 349
    Points : 409
    Points
    409
    Par défaut
    solution ....

    malgré l'application du patch, l'update se fait toujours de façon aléatoire ...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Select For Update (ib 6)
    Par Radj972 dans le forum InterBase
    Réponses: 1
    Dernier message: 07/02/2007, 17h14
  2. select for update LOCK 3 10gR2
    Par petitfrere dans le forum Oracle
    Réponses: 1
    Dernier message: 01/12/2006, 18h52
  3. Select For Update Nowait
    Par e1lauren dans le forum PostgreSQL
    Réponses: 1
    Dernier message: 28/09/2006, 22h04
  4. [MySql5]select ... for update
    Par melou dans le forum Requêtes
    Réponses: 1
    Dernier message: 20/04/2006, 11h11
  5. [Verrou] SELECT FOR UPDATE
    Par e1lauren dans le forum PostgreSQL
    Réponses: 10
    Dernier message: 13/10/2005, 17h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo