Hi, could anybody drop example how can I keep my oracle session context sync through FS application session? We use a lot oracle session context in our db layer (our DB PLSQL framework depend on values put in context). Because db connection from web container not dedicated I wonder how can I make it me virtually sync through one application login / logout session? |
Hi Atilla, You should use api_session API's to achieve what you want. Here is a tutorial: http://theformspider.com/learningcenter/tutorial-21-how-to-use-session-variables/ Hope this helps. Kind Regards |
I read it before and everything is clear how can I make some variables global through application user session. But my case is following:
But i want some global variables put into oracle session context because we use it in our framework on DB level. In step 2 i put these variables into oracle session context. And i in this oracle connection use it regularly. Because oracle connection brought from pool i have this java connection and oracle session connected and context is filled when i sing in. What happend when i through application usage got different oracle java connection (could i get it or in every application session is dedicated on java oracle connecti. If you use some pooling mechanism this not garantee to got same java connection as before)? Then i have empty oracle session context but application context is ok. My question how can i reset my oracle context in this situation? 1
HI Atilla, You can't reset your oracle session context. There is no magic trick. This is why I suggested to use api_session. api_session is your new context. If this does not seem feasible there is one more option: Currently, Formspider uses a session pooling mechanism and there is no guarantee that your code will always execute in the same oracle session. This can be changed though. The middle tier code can be modified so that each application runs with a dedicated database session. This is technically possible.
(27 Sep '13, 15:57)
Yalim Gerger ♦♦
|
I have idea to put some code to postDelta and then I can detect change of java connection a reset my oraclce session context. Is it doable? What You think about this solution? Hi Atillla, Let me first make sure that I understand correctly what you mean by Oracle session context: In session A you set a package global X to value 123. The next time you call this package global, (at a later point in the applicaion flow) you still want to it return 123, right? That's what you want? In Formspider, this doesn't work because each time your code executes it runs in a different database session (session B,C,D etc...). Best to my knowledge, the only way to get 123 when you reference X is to save the value of X to a database table before you finish executing your code and then the next time repopulate X from this table before you reference X. I don't know of any other way.
(27 Sep '13, 17:16)
Yalim Gerger ♦♦
|
I didn't mean of package global variables as a context variable. We have database object CONTEXT which is our containter of global variables. We use SYS_CONTEXT (<namespace>,<variable name="">) and DBMS_SESSION.SET_CONTEXT construction. I don't know much about DBMS_SESSION package but SYS_CONTEXT should just work with Formspider. We've been using it in Formspider source code for a while.
(28 Sep '13, 06:49)
Yalim ♦♦
|
Hi Atilla, I am not exactly sure what you need to achieve, but there is the concept of an 'Global application context' in the Oracle database. You can create a global session context where values are stored with a session id (in the SGA) , so that later when you make another connection with the same Formspider session, you can reuse these session context values. (every connection sets a session identifier for the global context, like In Glassfish you can set this in - JDBC Connection Pool Advanced settings. See for decumentation and usage examples: http://docs.oracle.com/cd/B28359_01/network.111/b28531/app_context.htm#CIHFJHCG Might be something to consider. Best, Michiel A |
Hi, I have a datasource based on a view using oracle context: Select column1, column2, ... from MY_VIEW t where ... and .. f.REINV_TYP = ctx_pkg.get_context('MY-CONTEXT-VAR') I use this view as a datasource in formspider. case 1) when I have set a concurrency column in datasource, I cannot save a new added record(a lot of no data found message are sent by docommit method) case 2) when i have NOT set a concurrency column in datasource, saving a new record does work! I supose that docommit method does some validations in case of concurrency column exists, and that docommit is executed in ANOTHER session than my code(that launched docommit), so it does not see whatever context values are set in my session, and this is the reason for those NO DATA FOUND messages. This is strange, as I've set api_application.setStateful(in_stateful_yn => 'Y'); in post_open event of application. Anyway, I'd appreciate any insights you'll poste here about how concurrency work. Thank you! |