home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,641 of 2,288   
   Syltrem to All   
   Re: Question on select count()   
   13 Aug 04 17:33:32   
   
   From: syltremzulu@videotron.ca   
      
   After exactly 51 inserts into a freshly created table, count will exceed 50.   
   :-)   
      
   I don`t see what you`re getting at.   
      
   Notes:    Committing after each insert will slow down your application.   
                 If you don`t commit, others won`t see the rows inserted. So   
   another process' "count" will not be affected, until you commit those   
   inserts.   
                You shouldn`t do a count iteratively in a loop, until 50 rows   
   have been inserted. Rather, count in your java code to keep trace of how   
   many you`ve inserted.   
      
   What are you trying to achieve?   
      
   Syltrem   
      
      
   "JP Belanger"  a écrit dans le message de   
   news:b399d6ce.0408131002.26efbf79@posting.google.com...   
   > I have a question on select count(), which may betray my lack of   
   > database knowledge.  Here goes.   
   >   
   > I have java code driving a transaction which goes like this:   
   >   
   > select count(*) from table   
   >   
   > (Java code in the same transaction)   
   > if count < 50 then ...   
   >   
   > insert into table values(blahblah)   
   > commit;   
   >   
   > it seems that if many of these transactions are running concurrently,   
   > count could exceed 50 unless oracle locks the table for inserts or   
   > deletes.   
   >   
   > Am I getting this wrong ?  Are there better solutions ?   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca