DAD&Procedure & Sessions
Hi,
I use DAD and procedure to download DOC files from BLOB in JSPs ,There are 3 sessions added in database each time. How can I reduce sessions?
Best Regards,
Yanming Xu
Hello Aleem,
We currently have the call for proposals open for the SDN and BPX sessions at SAP TechEd Bangalore. The call for proposals is open until August 31.
Please submit your proposal at https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/30278994-9402-2b10-7a98-e83ee0fa4add
The speakers of the winning proposals will receive complimentary lecture-only registration to SAP TechEd Bangalore.
Regards,
Christina
Similar Messages
-
SSO DAD access session storage?
Friends...
I need some help. I have created a new DAD (non Portal) on an external database. I have setup this DAD to be run with SSO only. I have a PL/SQL procedure running on the DAD. When I login to the portal I am setting a few session variables using session storage in a Dynamic page. Can I get session storage values from the Portal via the PL/SQL procedure running on the new DAD?
Any advise would be appreciated.
Larry Schenavar
[email protected]Tapas,
take a look at SharedObjects discussed in this thread: custom component - how to store java Properties object in ucm environment
intradoc.shared may contain also other classes that might be more convenient to your needs.
Jiri -
Procedure session resources?
How do you determine the difference in session resources between 1) running a SQL statement (with bind variables) in a client application such as SQL Developer versus 2) the same sql statement but instead by calling a procedure (accepting variables and returning the results in a refcursor)? Running the SQL in the client finishes faster than calling the procedure. What's the difference? I've seen before that running in a procedure requires explicit privileges as opposed to inheriting from role. Is there something similar with session resources?
Be careful of benchmarking this type of comparison using elapsed execution time. It almost always will be flawed and the comparison invalid.
And for a very simple reason. Elapsed performance of the VERY SAME SQL cursor in the SQL Shared Pool for the SAME DATA using the SAME EXECUTION PLAN, can and do differ!
Something as elementary as the number of physical I/O calls to make versus the number of logical I/O calls to make, can have a 3x (and even more) difference in performance.
So do not expect that the SQL you are using to benchmark the various options you have in mind, will each time around have the exact same elapsed execution time. Changes are excellent that this will not be the case.
Also keep in mind that the SQL cursor is a SQL cursor.. is a SQL cursor.
It does not differentiate on whether the client is using as ref cursor to reference it, an implicit PL/SQL cursor handle, an ODBC SQL statement handle, or whatever the case is. The type of interface that the client uses, does not impact the performance of the SQL cursor, beyond basic Oracle Call Interface settings like the size of an array fetch (to consume the output of that SQL cursor).
A reference cursor cannot make a SQL cursor slower than if that SQL cursor was created and used by a SQL-Developer client, or a C/C++ client.
The performance from the client perspective is how fast can it ship the output of that SQL cursors into local process memory and process that? In this respect, PL/SQL is faster (and will always be faster) than any other client (from C/C++ to Java and SQL-Developer and what not).
The path for the output of that SQL cursor to travel from SQL engine to the PL/SQL engine, is within the SAME process and merely across memory boundaries (by default from shared memory to private process memory).
For all other clients, that path is across process boundaries (from dedicated server process to client process). Or more typically, across machine boundaries too (meaning network travel).
This fact alone makes PL/SQL superior in consuming cursor output, in comparison with all other languages. The only thing faster is sticking the entire process into SQL code - and running the entire thing inside the SQL engine (that means data does not need to travel outside the boundaries of the SQL engine). -
Calling stored procedure from session bean method
I have a situation like this :
I have one method on a stateless session bean (and I mark this method as container managed transaction). For database related stuff, I am not using entity beans, I am using my own layer of OR mapping. This method does a lot of stuff and it involves many trips to the database, as a result of which the performance is very poor. I have identified certain pieces of functionality from this method which I think can be moved to stored procedures, while some of the functionality can still remain in the session bean method. So my scenario is like this :
session bean method start
store some data in tables(using my OR layer)
call the stored procedure
session bean method end
My question is :
Will the data that I am storing in tables from within the session bean method, be available to the code executing inside stored proc.
secondly, how do I sync the transcation which is being initiated by the container with the transaction under which the stored proc is executing or is it that the stored procedure code will also be executing under the container managed transcation.
Thanks
VimalHi Vimal,
Will the data that I am storing in tables from within
the session bean method, be available to the code
executing inside stored proc.There's only one way to find out (isn't there?)
secondly, how do I sync the transcation which is
being initiated by the container with the transaction
under which the stored proc is executing or is it
that the stored procedure code will also be executing
under the container managed transcation.Again, why not just "suck it and see!"
[Or is there some reason why you can't?]
As I interpret the EJB specification, if the transaction attribute for your session bean method is such that it starts a transaction, then that transaction will be terminated when the method completes -- and every operation that occurs within the framework of that method will be in the one transaction.
In other words, your database stored procedure should execute within the same transaction as your O/R mapping layer.
However, how OC4J behaves may not exactly follow what is written in the (EJB) specification. Hence I repeat, "try it and see for yourself".
Put it this way: as far as I know, the only way that your stored procedure would NOT see the changes made by your O/R mapping layer is if they both executed in separate transactions and the O/R mapping layer did not commit its changes before the stored procedure began its execution.
Hope this has helped.
Good Luck,
Avi. -
SAP IQ 16 remote procedure to MsSQL 2005 error.
Hi all,
I've in IQ a remote procedure that call via RPC an old MsSQL 2005 stored procedure.
In my old installation with IQ 12.7 ESD 4 all works well and I don't report any issues.
Actually with the new IQ 16.0 SP08 I've the following strange behaviours.
ERROR 1) When I call the remote procedure from IQ using SAP Interactive SQL all works well if I run the client from a remote host. I mean from an host which is not the server where IQ engine is running. If I execute the same call (always from SAP Interactive SQL) on the IQ engine server the following error is reported:
There was an error reading the results of the SQL statement.
The displayed results may be incorrect or incomplete.
Cursor not in a valid state
SQLCODE=-853, ODBC 3 State="24000"
Cursor not in a valid state
SQLCODE=-853, ODBC 3 State="24000"
Server 'SVR_PRODOTTI': [Microsoft][ODBC SQL Server Driver]Function
sequence error
SQLCODE=-660, ODBC 3 State="HY000"
ERROR 2) I've the following scenario:
a. I call a remote procedure (always the MsSQL 2005 remote procedure described above) inside a standard IQ stored procedure
b. the remote procedure fill a remote table with some data
c. in IQ after that the remote procedure is executed I want to get the produced data in IQ via proxy table
Looking at MsSQL side I note that step (a) and (b) are executed, but when step (c) start running it remains blocked by the session that had run step (a and b) even if they are already finished. Look at the following extraction of session state by MsSQL side.
SPID Status Login HostName BlkBy DBName Command CPUTime DiskIO LastBatch ProgramName SPID REQUESTID
177 SUSPENDED usr IQ_SERVER 287 master EXECUTE 0 0 06/19 17:31:38 Sybase IQ 177 0
287 sleeping usr IQ_SERVER . master AWAITING COMMAND 9829 153149 06/19 17:31:38 Sybase IQ 287 0
SPID = 287 (remote procedure call)
RPC Event 0 sp_remote_procedure;1
SPID = 177 (proxy table access)
Language Event 0 SELECT .... FROM .... t1
Environment details:
IQ -> SAP IQ 16.0 SP08 on Win 2012 R2 server (64 bit)
MSSQL -> MsSQL 2005 SP 2 32 bit Enterprise on Win 2003 server (32 bit)
Do you have any suggestions about this strange behaviours?
Best regards,
StefanoHi Tayeb,
thank you for your suggestions, following some improvement and details about my errors.
ERROR 1) [SOLVED]
In SAP Interactive SQL: Tools -> Options -> SAP Sybase IQ
The problem appear only if "Result processing" options are configured as:
"Show results from the last statement" --> ON
"Show only the first result set" --> ON
..hereafter I report the image that show the configuration that caused error.
Any other configuration of these two parameters doesn't show any problem.
ERROR 2) [already present]
I checked the IQ 16 SP08 doc and as you reported MsSQL 2005 is not listed in RPC certified systems.
I checked also the old IQ 12.7 ESD 4 (the version from which I want to migrate and where all works fine every day) doc and the same statement was reported. So not even in 12.7 release MsSQL RPC call seems to be certified, even if it still withou any problem.
After some other tests tracing also different debugging mode (-zo and -zr) I share the following result.
I tried the following use cases.
Note that "rem_mssql_TARGET" sp insert data in a local table on MsSQL which is selected by IQ via proxy "pr_DELTA_IQ".
[TEST A] - RDP via select
select
@max_date = RetDate,
@error = RetCode
from
DBA.rem_mssql_TARGET('2014-06-20 15:00:00')
insert into DBA.DELTA_IQ
FIELD_1,
FIELD_2
location 'TARGET_DB.TARGET_DB'
select
FIELD_1,
FIELD_2
from DBA.pr_DELTA_IQ
PROBLEM: on MsSQL all remains blocked, because proxy table extraction is blocked by remote procedure execution that result running.
If I kill the remote procedure session from MsSQL, IQ engine shutdown itself without any messages.
No data is inserted in DBA.DELTA_IQ.
[TEST B] - RDP via exec
exec DBA.rem_mssql_TARGET ('2014-06-20 15:00:00')
insert into DBA.DELTA_IQ
FIELD_1,
FIELD_2
location 'TARGET_DB.TARGET_DB'
select
FIELD_1,
FIELD_2
from DBA.pr_DELTA_IQ
PROBLEM: MsSQL doesn't report any blocking session.
IQ return the following message and the IQ server doesn't shutdown itself.
SQLCODE=-706, ODBC 3 State=“HY000”
Remote server does not have the ability to support this statement
Anyway all is rollbacked an no data is inserted in DBA.DELTA_IQ.
Do you have any other hints about it?
Thank you and regards,
Stefano -
Disadvantages of DAD Authentication
Dear Apex users,
Apex is a very nice tool to use, but sometimes it's hard to use features in the database. Almost all the authentication methods log on to the database with a single scheme, except the DAD Authentication Scheme.
This way it's hard to implement security in the database. CDM Ruleframe for example uses USER to fill journaling columns. With Apex this will result in APEX_PUBLIC_USER being the only user to modify the database. When you want to implement this right it's neccessary to change the code generated by CDM Ruleframe. But also the role based security is based on the user(=schema) that is logged on. You can use VPD, but this is much more complicated.
So I was very happy to find out that it is possible to log in as a real database user, being recognized by the database, using the Database Authentication (via DAD without username or password). When I perform htp.p(USER) in Apex it shows the real database user!
Yet the manual warns to only temporarily use this method, I cann't figure out why.
Are there (security?) reasons not to use this method?
Greets, DikDik,
You can always use the expression nvl(v('APP_USER'), user) to identify the authenticated user for journaling and the like.
If you use basic authentication (no username/password in DAD) the session user will be the authenticated user, as you point out. However, you still can't use roles other than to interrogate the roles the current user has been granted and to make decisions based on that.
The User's Guide describes the main disadvantage of this method:
"The main drawback of this approach is burdensome account maintenance, especially if
users do not administer their own passwords, or if their database accounts exist only
to facilitate authentication to your application."
Scott -
Regarding execution problem of PL/SQL file
Hi,
I have PL/SQL file. When I try to compile the file in a machine namely machine A it just hangs. Where as when I ftp the code to machine B wd then try to compile, then it compiles successfully. Bot the machines are unix machines. I just wante to know whether its a problem with my code or something wrong with the machine
Thanks in advanceIn database A, if session 1 is executing a stored procedure, the stored procedure will be locked. If you come along in session 2 and try to recompile the stored procedure, session 2 will be blocked until session 1 finishes. If there are lots of sessions trying to execute the stored procedure, session 2 could well be blocked for a long time.
Justin -
Ending a global transaction into WB
Hi,
today when I tried ton connect to my OWB project through the client, I get the following error:
PRS-00322:internal error, started new global transaction without ending existing global transaction.
I suppose there would be an "appended" global transaction into a still open procedure/session. I tried to kill all open sessions from the enterprie manager, but the error still exists.
Does anyone has any suggestions about this, or knows how to solve it?
Best regards,
Alessandrohave u tried this
alter system session kill immediate""..
else
login as sys and check status of OWB design user...see if that is locked
or at last
if possible reboot the database server -
Questions about application server architecture
Hello guys,
I have few questions about application server architecture�
I have a task to build a server application which will do the following: Clients (special java clients) will connect to it and send some data for further processing on server side. Chunks of data will be relatively small but they will take a lot of time for processing (it is ok that it will be quite slow).
Also server will run some sort of �database� where all clients� working data will be stored. So, in case a client loses its data he/she is always able to download it from the server.
For me it seems, like server will consist of the following components:
1. �Reception�. This part will be responsible for all client-communication procedures.
2. �Data storage�. This part will simply store all clients� data and provide some API interface for clients through �reception� to manage it (add/get/delete and so on).
3. �Processor�. Some sort of dummy-sophisticated module. It will take some input data from �data storage� when it receives order for this and process it. �Processor� will have two states: �busy� which means �processor� processing some data and �available� which means �processor� ready to process new data.
4. �Manager�. This part will always check �data storage� for new data and �processor� for availability. When �processor� and new data are available �manager� will make an order for �processor� to take new data from �data storage� and process it.
So, my question is the following: Which technology and approaches I should use to realize my plan?
I think that I can make �reception� as a Session Bean, but I don�t know yet, what are the best for the rest, for example �manager� and �processor�. I was thinking about writing my own application server (and I can do it), but I would like to learn j2ee technologies, so I think it is a perfect chance for me (I read a lot about j2ee before I wrote this post, but all examples have only �account�-�bill�-�money transfer� I think it is quite far away from reality or I am doing something wrong ;-)!
p.s. I am thinking about using JBoss as an Application Server. I tested it and wrote some tests. They work and run fast enough, so I like it. Moreover it has module architecture.
Please, give me some advises and tips!
Thank you in advance!1. �Reception�. This part will be responsible for all
client-communication procedures.Session bean with remote interface.
2. �Data storage�. This part will simply store all
clients� data and provide some API interface for
clients through �reception� to manage it
(add/get/delete and so on).Session bean that will use entity beans or hibernate to work with persistant data.
3. �Processor�. Some sort of dummy-sophisticated
module.Use a message driven bean. Make Reception to enqueue a message when new data is available for processing. Processor will process the data and store the resut in database using Data Storage session bean.
4. �Manager�. This part will always check �data
storage� for new data and �processor� for
availability. When �processor� and new data are
available �manager� will make an order for
�processor� to take new data from �data storage� and
process it.It's redundand component, because application server will manage messages and processors. -
9ias rel.2, modplsql and virtual path question
I am running 9iAS setup running a plsql-app.
http://myserver/DAD/procedure.
Problem is that in the html generated by these procedures there are references to images in the form of "http://myserver/DAD/img/image.jpg".
This caused call to an non existing img-procedure in the database and hence no graphics to show.
I tried using virtual path alias as follows:
Alias DAD/img/ "/MYDIR/img/"
<Directory /MYDIR/img/>
AllowOverride None
Order allow,deny
Allow from all
</Directory>
But it still comes up with the same error:
img: PROCEDURE DOESN'T EXIST
Can anyone point out what I am overlooking ??I am trying to fix it using 9iAS setup. I can't touch the procedures themselves unforunately.
-
How to execute a procedure in the same db session of the framework page
i am using oaframework personalization to create a link. when the link is clicked i will execute a database procedure using /psl/DAD/procedurename. currently when the user clicks on the link it will get executed in separate database session.
but i want execute the procedure in the db session on the current oa page. is there a way to achive this.
Thanks
sreekanth.gYou can do this, create a simple stackLayout region, add an AM, Controller to it. Add a submit button or link with fireAction set on it. Write a method in your AM and call it from your controller's processFormRequest by capturing the button or link event. In the AM method you can invoke the procedure. Use personalization and attach the region to the page.
-
Session Timeout and DAD Authentication
My application uses the authentication scheme 'No authentication (using DAD)'. The users log in from an external program and the user IDs are captured in the variable remote_user. My authorization scheme checks that the user ID exists in a database table. All this seems to work fine.
However, I need to implement a session timeout on the application. I've followed the steps described in the "Automatic Session Timeouts" utility in the Application Express Studio but when I tried to modify the authentication scheme by adding:
return auth_pkg.check_timeout;
to the Session Verify Function I got the following errors:
No functional attributes may be set when page sentry function is '-DATABASE-'.
and
Session verification function may not be specified if page sentry function is specified.
I'm new to Apex and I don't know where to go from here. Any advice please?
Thanks
MariaMaria,
The usual way to do the authentication part is to use a custom page sentry function. Many examples have been posted on the forum based on the ntlm page sentry code. Search for those keywords here (ntml page sentry) and you should find it easily. Then you can modify it by adding the session timeout logic in that function.
Scott -
PL/SQL procedure to kill inactive session
Hi all ,
Please i am trying to write a procedure to kill inactive sessions of the shema 'TESTSCHEMA' .This is my first procedure , am not use to pl/sql but i went through many turtorial but have some errors at compliation .when i try to compile the procedure the errors are as below :
15:50:28 Start Find Objects [TESTSCHEMA@TESTDB_UNIX(2)] ...
15:50:28 End Find Objects [TESTSCHEMA@ TESTDB_UNIX(2)]
15:50:32 Start Compiling 1 object(s) ...
15:50:32 Executing ALTER PROCEDURE fib_dead_cnx_cleanup COMPILE ...
15:50:32 [13:2] PL/SQL: ORA-00933: SQL command not properly ended
15:50:32 [9:3] PL/SQL: SQL Statement ignored
15:50:32 [18:12] PLS-00103: Encountered the symbol "(" when expecting one of the following:
15:50:32 constant exception <an identifier>
15:50:32 <a double-quoted delimited-identifier> table LONG_ double ref
15:50:32 char time timestamp interval date binary national character
15:50:32 nchar
15:50:32 The symbol "<an identifier>" was substituted for "(" to continue.
15:50:32 [18:21] PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
15:50:32 := ; not null default character
15:50:32 The symbol "; was inserted before "LOOP" to continue.
15:50:32 [27:8] PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
15:50:32 begin case declare exit for goto if loop mod null pragma
15:50:32 raise return select update while with <an identifier>
15:50:32 <a double-quoted delimited-identifier> <a bind variable> <<
15:50:32 close current delete fetch lock insert open rollback
15:50:32 savepoint set sql execute commit forall merge pipe
15:50:32 Compilation complete - 5 error(s) found
15:50:32 End Compiling 1 object(s)
below is the procedure code :
CREATE OR REPLACE
PROCEDURE fib_dead_cnx_cleanup
AS
l_serial CHAR(100);
l_sid CHAR (100);
l_sid_serial CHAR(100);
l_count NUMBER(10,0);
CURSOR session_cur IS
SELECT sid,serial#,sid||','||serial# as sid_serial
FROM v$session
WHERE username='EBBFCAT' and schemaname='TESTSCHEMA'
and status='INACTIVE'
BEGIN
BEGIN
l_count := 0;
OPEN session_cur;
WHILE ( 1 = 1) LOOP
BEGIN
FETCH session_cur INTO l_sid ,l_serial,l_sid_serial ;
EXIT WHEN session_cur%NOTFOUND ;
BEGIN
alter system kill session 'l_sid_serial' ;
END;
END;
END;
CLOSE session_cur;
END;
END FIB_DEAD_CNX_CLEANUP;
ThanksHi,
Never write, let alone post, unformatted code.
When posting any formatted text on this site, type these 6 characters:
{code}
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
Among the benefits of formatting: you can indent to show the extent of blocks, such as BEGIN-END.
Different types of blocks need modifiers after the end, such as "END *IF* " and " END *LOOP* ". If each opening statement (BEGIN, IF, LOOP) is directly above its corresponding END, then it's easy to check if you got the right modifier.
Here's what you code looks like with some formatting, and a couple of corrections added. Look for -- comments.
CREATE OR REPLACE
PROCEDURE fib_dead_cnx_cleanup
AS
l_serial CHAR(100);
l_sid CHAR (100);
l_sid_serial CHAR(100);
l_count NUMBER(10,0);
CURSOR session_cur IS
SELECT sid
, serial#
, sid || ','
|| serial# as sid_serial
FROM v$session
WHERE username = 'EBBFCAT'
and schemaname = 'TESTSCHEMA'
and status = 'INACTIVE'; -- need semicolon here
BEGIN
BEGIN -- Why?
l_count := 0;
OPEN session_cur;
WHILE ( 1 = 1)
LOOP
BEGIN -- Why?
FETCH session_cur
INTO l_sid
, l_serial
, l_sid_serial ;
EXIT WHEN session_cur%NOTFOUND ;
BEGIN -- Why?
alter system kill session 'l_sid_serial' ; -- Not a PL/SQL command
END;
END;
END LOOP; -- LOOP ends with END LOOP
CLOSE session_cur;
END;
END FIB_DEAD_CNX_CLEANUP;Take baby steps.
I've been wrtiing PL/SQL for 20 years, and I would never write that much code at once. If you're a beginner, all the more reason to start small. Write as little as possible, test, debug and test again (if necessary). When you have someting working, add 2 or 3 more lines and test again.
It looks like you have three BEGIN statements that don't serve any purpose. You should get rid of them (and their corresponding END statements, of course).
One error I did not fix: ALTER SYSTEM is not a PL/SQL statement. It's a SQL statement. You can run a SQL statement inside PL/SQL by using dynamic SQL, where you construct a string containing the SQL statement, and then use dbms_sql or EXECUTE IMMEDIATE to run it.
Edited by: Frank Kulash on Aug 18, 2009 12:37 PM -
How to remove an old iCloud account from my IPad. The account (email) was on my dad's name and he resently change it and now i can't reset or delete his iCloud account without his password. Please advise on the procedure. Thanks.
If you are trying to activate an iPad or iPhone and it is asking for a previous owners Apple ID and password, you have encountered the Activation Lock. This is a security feature that prevents thieves from setting up and using a stolen or lost iPad or iPhone. You have no alternative. You must use the previous owner's password to get permission to use the device. If you cannot get the password your father put on the iPad you will never be able to activate the device and no one can help you do it.
-
Can we restrict a Procedure to be called only once in a session or package?
Hi,
I am having a procedure which is called for each insert statement.
The code is non-Editable.
So, I want to restrict the procedure to be called only once for the entire session or package.
Could any one please suggest me, can we do this?
Thak you,
Regards,
Gowtham Sen.Hi,
Actually, I am using OWB tool. I used a procedure with output parameters, to map to the target table. So, OWB creates a package. In that package its calling the procedure for each record.
So, in order to avoid that, can I do any thing else, which would restrict it to call for each record.
Thank you,
Regards,
Gowtham Sen.
Maybe you are looking for
-
Problem using 7.01 updater
When I try up update dreamweaver mx 2004 with the 7.01 updater, I get an error message stating: "This folder does not contain Dreamweaver MX 2004. Yet the folder does contain it and it runs from there. Any suggestions?
-
Lightroom3 not reading NEF Raw file
Hi, I've got a Nikon D600 and always shoot in NEF RAW format and before I've been able to use the Lightroom with my files on a diferent computer which broke down... Now I'm on a new computer with Lightroom 3, which is Lightroom version: 3.6 [795620]
-
Every time I install adobe acrobat reader on my new intel mac it does not launch. the wheel just keeps spinning. Ihave uninstalled and reinstalled it several times. I have tiger. Sachin
-
Can CS3 & Premiere Pro 1.5 co-exist in the same system?
Yes, I know that by 2012 standards both pieces of software are outdated, but... Due to a resinstall of XP on a system that has a Matrox RT100 card (originally PPro 1.5, worked VERY nicely for YEARS!), and since I have CS3 in a newer "software only" v
-
I just returned to Java after a year in Ruby. Ruby had this handy loop for processing a range of numbers: for i in 1..10 do /* handle i in here */ endSo I wrote a Range class. Now the equivalent java, very nearly as handy, is: for (i: new Range(1,10)