BC4J Connection and database ROLE

Hi,
We have an application with several root Application Modules. We need to connect using a determined database user and role (with password). The problem is that the Connection Wizard does not support this feature.
I need to issue these commands after establishing connection:
SET ROLE my_role_name IDENTIFIED BY my_role_password
ALTER SESSION SET CURRENT_SCHEMA = my_schema
What is the best way to do that? I know I can issue those commands from each AM, but I'd like to do that in one place only (i.e. the connection or something like).
Thanks
Lapolla

You could derive from ApplicationModuleImpl and perform this operations in overwritten prepareSession() method.
Markus

Similar Messages

  • The problem of connect and resource role

    Hi,
    As we know, that while crating a new user, we can assign connect and resource so that the user can access the system tablespace.
    The problem that i got is instead of assigning the connect and resource role, i have assigned each and every privilege individually from this role. But, surprisingly, my user has not got the privilege o accessing the system tablespace.
    I was working in oracle 9i database. Can anyone help me in this regard and tell me what is the reason behind this?
    Thanks in advance.

    what huntrex said is quite valid i would like to add some more..
    SQL> create user myuser identified  by myuser
      2  /
    User created.
    SQL> select grantee,privilege
      2    from dba_sys_privs
      3   where grantee='MYUSER'
      4  /
    no rows selected
    SQL> grant resource to myuser
      2  /
    Grant succeeded.
    SQL> select grantee,privilege
      2    from dba_sys_privs
      3   where grantee='MYUSER'
      4  /
    GRANTEE                        PRIVILEGE
    MYUSER                         UNLIMITED TABLESPACEWhen you create a new user, the user is not able to save data until given a tablespace quota.As well when you create user and dont define its default tablespace then it is assigned tablespace what you defined at the time of database creation.If you dont define the tablespace at the time of creating database then it goes to system tablespace.
    When you grant resource role then user get unlimited tablespace over specified tablespace while creating users or
    default when not mentioning tablespace.
    conn myuser/muyuser
    SQL> select * from session_privs;
    PRIVILEGE
    CREATE SESSION
    ALTER SESSION[b]
    UNLIMITED TABLESPACE
    CREATE TABLE
    CREATE CLUSTER
    CREATE SYNONYM
    CREATE VIEW
    CREATE SEQUENCE
    CREATE DATABASE LINK
    CREATE PROCEDURE
    CREATE TRIGGER
    CREATE TYPE
    CREATE OPERATOR
    CREATE INDEXTYPEAs you created the user and i assume you didnt specify the default tablespace ,this user goes for system tablespace
    but you didnt assign resource role then you will have to have assign quota for that user to create any object within
    this created user.
    SQL> conn sys/sys as sysdba
    Connected.
    SQL> drop user myuser
      2  /
    User dropped.
    SQL> create user myuser identified by myuser
      2  /
    User created.
    SQL> grant connect to myuser
      2  /
    Grant succeeded.
    SQL> conn myuser/myuser
    Connected.
    SQL> select * from session_privs;
    PRIVILEGE
    CREATE SESSION
    ALTER SESSION
    CREATE TABLE
    CREATE CLUSTER
    CREATE SYNONYM
    CREATE VIEW
    CREATE SEQUENCE
    CREATE DATABASE LINK
    8 rows selected.
    SQL> create table mytable (a number)
      2  /
    create table mytable (a number)
    ERROR at line 1:
    ORA-01950: no privileges on tablespace 'USERS'
    SQL> conn sys/sys as sysdba
    Connected.
    SQL> grant unlimited tablespace to myuser
      2  /
    Grant succeeded.
    SQL> conn scott/tiger
    Connected.
    SQL> conn myuser/myuser
    Connected.
    SQL> create table mytable (a number)
      2  /
    Table created.
    SQL> Khurram

  • BC4J temp tables & database role

    There are two essential BC4J temp tables (PCOLL_CONTROL, PS_TXN), along with others: http://www.oracle.com/technetwork/developer-tools/jdev/overview/bc4j-temp-tables-087270.html
    We have 'sysadmin' role associated in our Development DB, the passivation store table PS_TXN is populated as expected.
    However, in our production DB, we ONLY manually created the two above tables granted with Insert/Delete/Update/Select permissions (DBA will NOT agree to assign 'sysadmin' role), PS_TXN is not populated at all, which results in some session management issue in our application.
    So the question is: What is the proper database role to associate with for the temp tables to work properly (in our case, we use SQL server data source).
    Thank you,

    Mike, you need at least to add a sequence (PS_TXN_SEQ if I remember right) do you need to add a grant to create a sequence.
    Timo

  • Connect and resource role

    I have created a user and granted connect,resource to that user.
    Then how the unlimited tablespace quota is applied automatically over that user?
    whereas when I am applying all the privileges under the connect,resource separately the user is not getting any quota on any tablespace. What is actually happening in case of connect,resource role in oracle9i?

    hi in 9i RESOURCE role is having unlimited tablespace privilege internally
    even you cannot see this from role_sys_privs view.
    so it is dangerous to grant resource role to a user in 9i unless required.

  • File connection and database connection as a parameter

    hi
    i am using ssis 2012, now i want all my  connection ,database and file connection as a parameter.
    how to do it

    Hi coool_sweet,
    If I understand correctly, you want to use a parameter to control the connection string of flat file or database.
    If in this scenario, we can add two parameters in the package with appropriate values, like the connection string of flat file and the connection string of database. Then use an expression with the parameter value to control the ConnectionString property
    of Flat File Connection Manager and the ConnectionString property of OLE DB Connection Manger. The following screenshot is for your reference:
    Besides, as Arthur said above, if you want to change the ConnectionString property of Flat File Connection Manager and the ConnectionString property of OLE DB Connection Manger via changing parameter values after deploying the package to SSISDB, there is no
    need to do this. Because we can also change the connection manager properties in the Configure dialog box as below:
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • DB Connect and Database Views

    Hello,
    I am writing a function module to access an external Oracle database that has been defined in our ABAP system using DBConnect.
    I would like to use Open SQL instead of Native SQL to access the data in the remote table.  Is this possible?  I believe that in order to do this, a view of the remote table would have to be defined in the ABAP data dictionary via SE11, but I am unable to do this.
    Does anyone know if this is possible, or am I required to use Native SQL when accessing an external database?
    Regards,
    -Matt Schababerle

    Hi,
    Chek out these two links.
    It would be helpful:
    Access external Oracle database with ABAP
    external oracle database connection
    Regards,
    Anjali

  • Logins and Database roles

    It seems a simple topic but I just wanted to check so it doesn't confuse me anymore:
    i) can more than one SQL Login be associated with one database user e.g. SQL login a and b associated with the login dbo
    I have attempted to associate two logins with one database user but SQL doesn't allow me to do this.

    One database user can only be mapped to one SQL Login.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Database roles

    Hello, please i have a question:
    Is there any way to find out roles that belong to database only?, e.g.: EXECUTE_CATALOG_ROLE, GATHER_SYSTEM_STATISTICS, etc, because if i query dba_roles table, it selects all the roles including application ones.
    Thanks in advance.

    Each database version may have its own predefined roles, these cannot be derived from DBA_ROLES,only from documentation. For 10g:
    5.2.7 Predefined Roles
    The following roles are defined automatically for Oracle Database:
    CONNECT
    RESOURCE
    DBA
    EXP_FULL_DATABASE
    IMP_FULL_DATABASE
    These roles are provided for backward compatibility to earlier versions of Oracle Database and can be modified in the same manner as any other role in an Oracle database.
    Note:
    Each installation should create its own roles and assign only those privileges that are needed, thus retaining detailed control of the privileges in use. This process also removes any need to adjust existing roles, privileges, or procedures whenever Oracle Database changes or removes roles that Oracle Database defines. For example, the CONNECT role now has only one privilege: CREATE SESSION. Both CONNECT and RESOURCE roles will be deprecated in future Oracle versions.
    Werner

  • (Cisco Historical Reporting / HRC ) All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054

    Hi All,
    I am getting an error message "All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054"  when trying to log into HRC (This user has the reporting capabilities) . I checked the log files this is what i found out 
    The log file stated that there were ongoing connections of HRC with the CCX  (I am sure there isn't any active login to HRC)
    || When you tried to login the following error was being displayed because the maximum number of connections were reached for the server .  We can see that a total number of 5 connections have been configured . ||
    1: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Current number of connections (5) from historical Clients/Scheduler to 'CRA_DATABASE' database exceeded the maximum number of possible connections (5).Check with your administrator about changing this limit on server (wfengine.properties), however this might impact server performance.
    || Below we can see all 5 connections being used up . ||
    2: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:[DB Connections From Clients (count=5)]|[(#1) 'username'='uccxhrc','hostname'='3SK5FS1.ucsfmedicalcenter.org']|[(#2) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#3) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#4) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#5) 'username'='uccxhrc','hostname'='47BMMM1.ucsfmedicalcenter.org']
    || Once the maximum number of connection was reached it threw an error . ||
    3: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Number of max connection to 'CRA_DATABASE' database was reached! Connection could not be established.
    4: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Database connection to 'CRA_DATABASE' failed due to (All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054.)
    Current exact UCCX Version 9.0.2.11001-24
    Current CUCM Version 8.6.2.23900-10
    Business impact  Not Critical
    Exact error message  All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054
    What is the OS version of the PC you are running  and is it physical machine or virtual machine that is running the HRC client ..
    OS Version Windows 7 Home Premium  64 bit and it’s a physical machine.
    . The Max DB Connections for Report Client Sessions is set to 5 for each servers (There are two servers). The no of HR Sessions is set to 10.
    I wanted to know if there is a way to find the HRC sessions active now and terminate the one or more or all of that sessions from the server end ? 

    We have had this "PRX5" problem with Exchange 2013 since the RTM version.  We recently applied CU3, and it did not correct the problem.  We have seen this problem on every Exchange 2013 we manage.  They are all installations where all roles
    are installed on the same Windows server, and in our case, they are all Windows virtual machines using Windows 2012 Hyper-V.
    We have tried all the "this fixed it for me" solutions regarding DNS, network cards, host file entries and so forth.  None of those "solutions" made any difference whatsoever.  The occurrence of the temporary error PRX5 seems totally random. 
    About 2 out of 20 incoming mail test by Microsoft Connectivity Analyzer fail with this PRX5 error.
    Most people don't ever notice the issue because remote mail servers retry the connection later.  However, telephone voice mail systems that forward voice message files to email, or other such applications such as your scanner, often don't retry and
    simply fail.  Our phone system actually disables all further attempts to send voice mail to a particular user if the PRX5 error is returned when the email is sent by the phone system.
    Is Microsoft totally oblivious to this problem?
    PRX5 is a serious issue that needs an Exchange team resolution, or at least an acknowledgement that the problem actually does exist and has negative consequences for proper mail flow.
    JSB

  • FW: ADF BC4J unable to connect to database on Application Server 10.1.3.1.0

    Please see ADF BC4J unable to connect to database on Application Server 10.1.3.1.0

    Hello Steve. I'm getting the same error message as Carlos got when he tried to fire up the SRDemo. Following logon the splash screen has this error message:
    Error
    Failed to checkout SRService application module. Ensure your datasource name is SRDemo [case-sensitive!] and that connection settings are properly defined for a database with the SRDEMO schema installed. See server log for more exception details...
    Apparently you guys have figured out a fix for this, but my command of JDeveloper/J2EE jargon is pretty limited at this point in my learning curve. (I've heard about Jndi, but have no idea what it does). Is there a statement I can add to the web.xml file that will fix this? If so, what is that statement, and where does it go in web.xml?
    Thanks in advance.

  • (IMP)Application module and database connection

    Hi,
    How application module pooling and database connection pooling is working ?
    Currently i m facing a problem like if i am creating 10 browser session then it doesn't mean that i'll have only 10 db sessions. While closing the browser session of application module time out respective db session is not removed.
    In this case, invalid db session are created in bulk which is crashing database sometime. We have writter script to kill those session periodically but in this case if application module is accessing such dbconnection then we are getting session killed error or not logged in error.
    To over come we need to bounce the server (middle tier).
    Is there any proper way to solve this or am i doing something wrong ?
    Please let me know if you need any more details.
    Thanks in advance
    Devang

    Thanks for your prompt reply Ricky.
    I just found out that in some of the JSP pages in application
    <jbo:ReleasePageResources/> is not written. Should this problem arise because of this?
    could you please tell me how can I release page resources in UIX pages ?
    Datasources.xml file content
    <data-source class="com.evermind.sql.DriverManagerDataSource"
    name="AITDS"
    location="jdbc/AITCoreDS"
    pooled-location="jdbc/pooled/AITPDS"
    xa-location="jdbc/xa/AITXADS"
    ejb-location="jdbc/AITDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username=<USERNAME>
    password=<PASSWORD>
    url=<URL>
    inactivity-timeout="30"
    />
    bc4j.xcfg file
    <BC4JConfig>
    <AppModuleConfigBag>
    <AppModuleConfig name="GsaServerModuleLocal">
    <DeployPlatform>LOCAL</DeployPlatform>
    <JDBCDataSource>jdbc/AITCoreDS</JDBCDataSource>
    <jbo.project>gsa</jbo.project>
    <AppModuleJndiName>oracle.appsit.gsa.server.GsaServerModule</AppModuleJndiName>
    <java.naming.factory.initial>oracle.jbo.common.JboInitialContextFactory</java.naming.factory.initial>
    <ApplicationName>oracle.appsit.gsa.server.GsaServerModule</ApplicationName>
    </AppModuleConfig>
    </AppModuleConfigBag>
    </BC4JConfig>
    Let me know if you need any more detail.
    Thanks in advance
    Devang

  • Performance with MySQL and Database connectivity toolbox

    Hi!
    I'm having quite some problems with the performance of MySQL and Database connectivity toolbox. However, I'm very happy with the ease of using database connectivity toolbox. The background is:
    I have 61 variables (ints and floats) which I would like to save in the MySQL-database. This is no problem, however, the loop time increases from 8ms to 50ms when using the database. I have concluded that it has to do with the DB Tools Insert Data.vi and I think that I have some kind of performance issue with this VI. The CPU never reach more the 15% of its maximum performance. I use a default setup and connect through ODBC.
    My questions are:
    1. I would like to save 61 variables each 8-10ms, is this impossible using this solution?
    2. Is there any way of increasing the performance of the DB Tools Insert Data.vi or use any other VI?
    3. Is there any way of adjusting the MySQL setup to achieve better performance?
    Thank you very much for your time.
    Regards,
    Mattias

    First of all, thank you very much for your time. All of you have been really good support to me.
    >> Is your database on a different computer?  Does your loop execute 61 times? 
    Database is on the same computer as the MySQL server.
    The loop saves 61 values at once to the database, in one SQL-statement.
    I have now added the front panel and block diagram for my test-VI. I have implemented the queue system and separate loops for producer and consumer. However, since the queue is building up faster then the consumer loop consumes values, the queue is building up quite fast and the disc starts working.
    The test database table that I add data to is created by a simple:
    create table test(aa int, bb char(15));
    ...I'm sure that this can be improved in some way.
    I always open and close the connection to the database "outside the loop". However, it still takes some 40-50 ms to save the data to the database table - so, unfortunatly no progress to far. I currently just want to save the data.
    Any more advise will be gratefully accepted.
    Regards,
    Mattias
    Message Edited by mattias@hv on 10-23-2007 07:50 AM
    Attachments:
    front panel 2.JPG ‏101 KB
    block diagram.JPG ‏135 KB

  • I run Dev 6i on Windows 2008 R2 64-bit,the forms are working fine after connection to the database but the reports continue to request for username, password and database connection string every time i try to open a report.

    I receive REP-0501: Unable to connect to specified database. I run developer 6i application on windows 2008 r2. I have applied the nn60.dll and nnb60.dll files to the \BIN directory. The forms are working fine. The reports will only display after the correct user id (username, password and database connection string) is supplied. This is happening to all attempts to open already complied form. Pls, help.

    If you are connecting to an Oracle 11g database, remember that by default the passwords are case sensitive. To disable that, run
    ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;

  • Connection Pool and Database Sessions

    Hi,
    Is there any way to use the connection pool or Datasource while connecting to database?If I am using a stateless sesssion bean and using a Data Access layer which just creates a database session to write the persistence toplink objects how I can make use of application server connection pool?
    Thanks,
    Vinod

    Hi,
    Is there any way to use the connection pool or Datasource while connecting to database?If I am using a stateless sesssion bean and using a Data Access layer which just creates a database session to write the persistence toplink objects how I can make use of application server connection pool?Hi Vinod,
    Yes, TopLink allows you to use the app server's connection pooling and transaction services. Chapter 2 of the Oracle9iAS TopLink Foundation Library Guide provides details as do the TopLink examples. The easiest way to set this up is by using the sessions.xml file. The sample XML below is from the file <toplink903>\examples\ias\examples\ejb\sessionbean\sessions.xml. Here we are adding the datasource defined in OC4J and specifying that we are using the OC4J transaction controller also.
    <login>
    <user-name>sa</user-name>
    <password></password>
    <datasource>java:comp/env/jdbc/ejbJTSDataSource</datasource>
    <uses-external-transaction-controller>true</uses-external-transaction-controller>
    <uses-external-connection-pool>true</uses-external-connection-pool>
    </login>
    <external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
    When using this approach you need to change your TopLink code slightly in the EJB methods:
    a. Acquire the ACTIVE unit of work from the server
    session (again, see the EmployeeSessionEJB code
    example) with something like:
    UnitOfWork uow = clientSession.getActiveUnitOfWork();
    b. Calls to uow.commit() can be ommitted or commented out
    because the EJB will handle this. Note that of course
    the methods you create in the EJB that are using this
    approach must have TX Required (default).
    Hope this helps.
    Pete

  • Servlets/JDBC - Connect to database ONCE and not in every servlet - How?

    Hello, I'm using servlets and JDBC.
    In every servlet , i connect to the database and then i close the connection, but this is not ptactical.
    I would like to connect to the database once (at the beginning) when container starts and then close the connection.
    How am i supposed to do that?
    Thanks, in advance!

    Bad idea. Don't do that. The connection will timeout sooner or later (depends on DB used, it's usually around 30 mins) and your application will crash.
    You should always acquire and close the connection (and statement and resultset!) in the shortest possible scope. To improve connecting performance just use connection pooling.
    Create a DAO class which does all the task and just instantiate and assign it as Servlet class variable during Servlet's init() method. For more insights and code samples start here: [http://balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html].
    To go back to your fundamental question, doing some stuff during startup and shutdown of webapp, you could use the ServletContextListener for this. But again, do NOT do this to get hold of an external resource such as a connection! It's receipt for trouble.

Maybe you are looking for

  • No drives shown in printer setup utility

    Accidently erased printer drive for Hp deskjet 935c, when I went into printer setup utility app there was no drivers displayed even when I hit "more printers" still no divers were shown. I thought somthing wrong with printer setup utility app so I re

  • TS4436 Problem with camera effects.. Browsed my gallery all my photo effects gone ?

    Hey !! Just noticed before uploading pictures that all my effects I'd applied on camera shots have returned to natural or no effect when I browsed the gallery , when you click edit however the picture is with the effect I started with and you cannot

  • Unable to install Active X and Flash Plugin for Acrobat

    I would like to create a PDF Portfolio in Acrobat Pro XI. However, once I have selected the files I get a notification that states, "To view the Flash technology content in this PDF file, please install this version of Flash Player that supports Adob

  • How to pass the chinese input insert into DB

    hi guys, i am the new one in developing the multilingual software. let me explain : the tools used are : Jboss 4.0.4 , MySQL, Eclipse. user key in the chinese or other languages[like greek] in the jsp page. then will uses <form .......... method="pos

  • TREX not indexing document 10 KB

    hi...   TREX search is working fine for documents < 10 KB but if i try indexing documents > 10 KB it gives prperation failed error.Please let me know what as to be done so that it indexes document > 10 KB Please help me on this as it is very urgent T