RE: [PHP-DB] OCIPLogon

2003-07-09 Thread RENAULT, François

the first OCIexecute($statement, OCI_DEFAULT); 
has not been commited
so when you reconnect ,  your cursor is closed and rollbacked with the 2nd PLogon 

-Message d'origine-
De : Sapporo [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 9 juillet 2003 16:03
À : [EMAIL PROTECTED]
Objet : [PHP-DB] OCIPLogon


Hi,

I'm trying to avoid excessive database connections within my app.

 From the docs, I figured that the following code would insert 2 rows of 
data into table Dummy, since the connection would be reused and the 
transactions aren't isolated by using OCINLogon() (error handling left 
out for readability):

$conn = OCIPLogon(scott, tiger, testdb);
$statement = OCIparse($conn, INSERT INTO Dummy VALUES ('A'));
OCIexecute($statement, OCI_DEFAULT);

$conn = OCIPLogon(scott, tiger, testdb);
$statement = OCIparse($conn, INSERT INTO Dummy VALUES ('B'));
OCIexecute($statement, OCI_DEFAULT);

OCICommit($conn);

But it turns out that only the second row gets written to the database. 
So, what difference would it make to use OCINLogon()? Is this the 
expected behaviour?

How does everyone else handle this? Is it possible to store database 
connections in a session?

TIA,
-sapporo.

BTW, I'm using PHP 4.3 on Linux talking to Oracle9i.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] OCIPLogon , maximum number of sessions apache/php- Oracle

2002-07-09 Thread Steve Farmer

Hi Michael,

So what you are saying is that apache/php will keep opening sessions 
until oracle runs out of processes or cursors or memory or hits 
session_per_user maximum ??

I was thinking of experimenting with the profile parameter IDLE_TIME 
Profile Parameter to make oracle close open sessions after a certain 
amount of time , have you any experience with this?

I have

open_cursors  = 500
processes   = 200
max_enabled_roles = 30

regards
Steve
At 8:24 AM +0200 9/7/02, Michael Bretterklieber wrote:
Hi,

this depends on your settings in the initinstance.ora in the 
directory /opt/oracle/OraHome1/admin/instance/pfile dir.

Here are some settings:
processes = 150
open_cursors = 300
max_enabled_roles = 30

you also have to set the sizes of the shared-memory pool.

bye,

Steve Farmer wrote:

Hi all,

Does anyone know how many sessions can be opened by apache/php to 
Oracle using OCIPlogon, or what parameter setting controls this?

TIA
Steve


--
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
  - Dennis Ritchie and Ken Thompson, June 1972

-- 
-
Minds are like parachutes, they work best when open
Support free speech; visit http://www.efa.org.au/

Heads Together Systems Pty Ltd http://www.hts.com.au
Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] OCIPLogon , maximum number of sessions apache/php - Oracle

2002-07-09 Thread Michael Bretterklieber

Hi,

first we when we started up with oracle we had problems with these params:
processes, open_cursors, max_enabled_roles

After a week or so oracle was not able to allocate shared memory, 
something like this:
ORA-04031: unable to allocate 4200 bytes of shared memory (shared
pool,TRIGGER$,sga heap,state objects) ORA-00604: error occurred at

(remember I'm allways talking about Oracle under Linux)

This had 2 reasons:
1. wrong kernel-params (shared-memory-limits and semaphore-limits)
2. a memory leak in Oracle 8.1.7 (applying patchset 3 resolved this)

bye,

Steve Farmer wrote:

 Hi Michael,

 So what you are saying is that apache/php will keep opening sessions 
 until oracle runs out of processes or cursors or memory or hits 
 session_per_user maximum ??

 I was thinking of experimenting with the profile parameter IDLE_TIME 
 Profile Parameter to make oracle close open sessions after a certain 
 amount of time , have you any experience with this?

 I have

 open_cursors  = 500
 processes   = 200
 max_enabled_roles = 30

 regards
 Steve
 At 8:24 AM +0200 9/7/02, Michael Bretterklieber wrote:

 Hi,

 this depends on your settings in the initinstance.ora in the 
 directory /opt/oracle/OraHome1/admin/instance/pfile dir.

 Here are some settings:
 processes = 150
 open_cursors = 300
 max_enabled_roles = 30

 you also have to set the sizes of the shared-memory pool.

 bye,

 Steve Farmer wrote:

 Hi all,

 Does anyone know how many sessions can be opened by apache/php to 
 Oracle using OCIPlogon, or what parameter setting controls this?

 TIA
 Steve



 -- 
 --
 Michael Bretterklieber
 LCP
 JAWA Management Software GmbH
 Liebenauer Hauptstr. 200
 A-8041 GRAZ
 Tel: ++43-(0)316-403274-12
 Fax: ++43-(0)316-403274-10
 GSM: ++43-(0)676-93 96 698
 [EMAIL PROTECTED]
 homepage: http://www.jawa.at
 - privat ---
 E-mail:   [EMAIL PROTECTED]
 homepage: http://www.inode.at/mbretter
 --
 ...the number of UNIX installations has grown to 10, with more 
 expected...
- Dennis Ritchie and Ken Thompson, June 1972



-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972 




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php