Root Application Module connecting to 2 databases technologies
I have an application which needs to connect to 2 different databases.
I managed to get access to each databases in their own respective Application Modules.
In order to achieve that, I created a new ViewObject within the "oracle" model, and still used the "MySQL" query. Using the jbo.envinfoprovider property, I can force the Application module to connect to the appropriate database, MySQL in this case.
Now, my problem is that I need to have a Root application module that will use BOTH "child" application module and eventually BOTH database connections. At the moment, I can only use one at a time. Using the jbo.envinfoprovider property of the ROOT application module allows me to select which of the 2 database I want to use, but I need both.
To put it in a tree-like structure, here's what I want to achieve :
ROOT (Oracle + MySQL)
|
|__ AppModule1 (Oracle)
| |
| |__ View1
| |__ View2
|
|__ AppModule2 (MySQL)
|
|_ View3
What I mean is if I deploy the application on the integrated weblogic server, using the default navigation flow defined in the adfc-config.xml file, when I reach the "forensic" page, it will try to "read" from both database and fail at reading the second database.
The page displays the following :
1- a table containing the records from the Oracle database (3 columns=> ID, pattern, solution)
2- an adf_form used to populate the above table :
- the ID is bound to a database trigger, so is set to readonly
- the solution is a text input field
- the Pattern is a LoV, based on the data found on the MySQL database.
If I test the page from the "forensic.jspx" itself (by right-clicking and selecting "Run"), I can manage the data just fine (I can do any CRUD operations I want)
on the other hand, if I go to the "adfc-config.xml" file and (right-click and then select "Run"), the page will only read one of the two database (I can control which one, by changing the jbo.envinfoprovider property of my application module)
Hope this helps understand what I am trying to achieve.
Thanks !
Similar Messages
-
Best Practice to use a single root Application Module?
I was reading in another thread that it may be a good idea to have all application modules nested within a single root application module (AM) so that there is only 1 session maintained for the root AM, versus an individual session for each AM. Is this a best practice? If yes, should the root AM be a skeleton AM (minimal customer service methods), or, should you select the most heavily used AM and nest the other AM's underneath of it?
In my case, I currenlty have 2 AM's (and will have 3 AM's in the future) each representing a different set of use cases withn the application (i.e., one supports users searches / shopping cart-like functionality, and the second supports an enrollment process.) It could be the case that a user only accesses pages on the web site to do searches (first AM), or only to do enrollment (2nd AM), or, they may access pages of the site that access both AM's. Right now I have 2 separate AM's that are not nested. Should I nest the AM's and define a root AM?
thanksHi javaX
The main physical effect of having 2 separate AMs is that they have their own transactions with the database, and presumably sit in the application module pool as their own instances consuming connections from the connection pool. Alternatively a single root AM with 2 nested AMs share a single transaction through the root AM; only the root AM controls the transaction in this scenario.
As such it's a question of do you need separate transactions or will one suffice?
How you group your EOs/VOs etc within the AMs is up to you, but usually falls into logical groups such as you have done. If a single transaction is fine, instead of creating multiple AMs, you could instead just create logical package structures instead. Neither method is right or wrong, they're just different ways of structuring your application.
When you create a nested AM structure, within your ViewController project in the Data Control Palette you'll actually see 3 data controls mapped to each AM. In addition expanding the root AM data control, you'll see the nested AMs again. Create a dummy project with a nested AM structure and you'll see what I mean.
If you base your page definitions on anything from the root AM and it's children in the Data Control Palette, this will work on the root AM's transaction.
If you base your page definitions on something from one of the other AM data controls that isn't inside the main root AM in the Data Control Palette, instead of using the root AM's transaction, the separate child AM will be treated as root AM and will have its own transaction.
The thing to care of when developing web pages is to consistently use the AM and it's nested AMs, or the child AMs directly with their separate transactions, otherwise it might cause a bit of a nightmare debugging situation later on when the same application is locking and blocking on the same records from 2 separate AM transactions.
Hope this helps.
CM. -
How do the application servers connect the new database after failing over from primary DB to standby DB?
We have setup a DR environment with a standalone Primary server and a standalone Physical Standby server on RHEL Linux 6.4. Now our application team would like to know:
When the primary DB server is crashed, the standy DB server will takeover the role of primary DB through the DataGuard fast failover. As the applications are connected by the primary DB IP before,currently the physical DB is used as a different IP or listener. If this is happened, they need to stop their application servers and re-configure their connection so the they coonect the new DB server, they cannot tolerate these workaround.
Whether does oracle have the better solution for this so that the application can automatically know the role's transition and change to the new IP without re-confige any connection and shutdown their application?
Oracle support provides us the answer as following:
==================================================================
Applications connected to a primary database can transparently failover to the new primary database upon an Oracle Data Guard role transition. Integration with Fast Application Notification (FAN) provides fast failover for integrated clients.
After a failover, the broker publishes Fast Application Notification (FAN) events. These FAN events can be used in the following ways:
Applications can use FAN without programmatic changes if they use one of these Oracle integrated database clients: Oracle Database JDBC, Oracle Database Oracle Call Interface (OCI), and Oracle Data Provider for .NET ( ODP.NET). These clients can be configured for Fast Connection Failover (FCF) to automatically connect to a new primary database after a failover.
JAVA applications can use FAN programmatically by using the JDBC FAN application programming interface to subscribe to FAN events and to execute event handling actions upon the receipt of an event.
FAN server-side callouts can be configured on the database tier.
FAN events are published using Oracle Notification Services (ONS) and Oracle Streams Advanced Queuing (AQ).
=======================================================================================
Who has the experience and the related documentation or other solutions? we don't have the concept of about FAN.
Thank very much in advance.Hi mesbeg,
Thanks alot.
For example, there is an application JBOSS server connecting the DB, we just added another datasource and put the standby IP into the configuration file except adding a service on DB side like this following:
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jta="false" jndi-name="java:/jdbc/idserverDatasource" pool-name="IDServerDataSource" enabled="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:@<primay DB IP>:1521:testdb</connection-url>
<connection-url>jdbc:oracle:thin:@<standby DB IP>:1521:testdb</connection-url>
<driver>oracle</driver>
<pool>
<min-pool-size>2</min-pool-size>
<max-pool-size>10</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>TEST_USER</user-name>
<password>Password1</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<use-fast-fail>false</use-fast-fail>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="oracle" module="com.oracle.jdbc">
<xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
If the failover is occurred, the JBOSS will automatically be pointed to the standby DB. Additional actions are not needed. -
Painting one root Application Module to rule them all
hi
The description below uses the same MyApplicationModuleListener approach as I describe in the forum thread "painting a picture of Application Module pooling".
Another example review of Application Module pools behaviour is the blog post by Chris Muir, "JDev 11g, Task Flows & ADF BC – one root Application Module to rule them all?".
That post also says "... we'll have trouble discerning what the ADF BC layer is actually doing underneath the task flow transaction options. ...", where the approach below might help alleviate some of that discerning trouble.
And about "... By deduction as there are no other log entries, this second instance of Root1AppModule must be nested under the root Root1AppModule? ..." more information will be logged, so less deduction is required.
The blog post describes an application similar to this one (which is using the HR.EMPLOYEES table) created using JDeveloper 11.1.1.6.0
at http://www.consideringred.com/files/oracle/2012/OneSizeOneRootAMApp-v0.01.zip
It uses somewhat different names than the blog post, and it has two sets of task-flows so that no transaction configuration changes are required to review the behaviour.
When a MyApplicationModuleListener approach is introduced (with minor changes, mostly configuration, using JAR files available in MyApplicationModuleListenerApp-v0.03.zip) it results in the application available
at http://www.consideringred.com/files/oracle/2012/OneSizeOneRootAMApp-v0.02.zip
Using this, the (chained) "No Controller Transaction" scenario's result in similar logging like this:
[C][L][r1001][(ctx31) /faces : /firstIndex] setRequestInfoPrefix() : extra [GET with 3 parameters (partial request false) (initial render true) (postback true)]
[C][L][r1002][(ctx32) /faces : /firstIndex] setRequestInfoPrefix() : extra [GET with 3 parameters (partial request false) (initial render true) (postback true)]
[C][L][r1001][(ctx31) /faces : /firstIndex] onAfterRequest() : no ApplicationPools
[C][L][r1002][(ctx32) /faces : /firstIndex] onAfterRequest() : no ApplicationPools
[C][L][r1003][(ctx31) /faces : /firstIndex] setRequestInfoPrefix() : extra [POST with 5 parameters (partial request false) (initial render false) (postback true)]
[C][L][r1003][(ctx31) /faces : /firstIndex] onNewConstruction() : [(am501) FirstAppModuleImpl_1 (not root) parent = (null)]
[C][L][r1003][(ctx31) /faces : /firstIndex] onActivate() : [(am501) FirstAppModule (is root)](session version 11.1.1.61.92 oracle.jbo.server.SessionImpl@16cbcec)
[C][L][r1003][(ctx31) /faces : /firstIndex] onCreate() : [(am501) FirstAppModule (is root)]
########FirstAppModuleImpl.create() called. AM isRoot() = true
[C][L][r1003][(ctx31) /faces : /firstIndex] onAfterConnect() : [(am501) FirstAppModule (is root)]
[C][L][r1003][(ctx31) /faces : /firstIndex] onPrepareSession() : [(am501) FirstAppModule (is root)]
########FirstAppModuleImpl.prepareSession() called. AM isRoot() = true
[C][L][r1003][(ctx31) /faces : /firstIndex] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
[C][L][r1003][(ctx31) /faces : /firstIndex] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
[C][L][r1003][(ctx31) /faces : /firstIndex] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[C][L][r1003][(ctx31) /faces : /firstIndex] onNewShortId() : pNewShortId = ds81, pId = java:comp/env/jdbc/connHRDS - com.bea:ServerRuntime=DefaultServer,Name=OneSizeOneRootAMApp@connHR@connHR,ApplicationRuntime=OneSizeOneRootAMApp,Type=JDBCDataSourceRuntime
[C][L][r1003][(ctx31) /faces : /firstIndex] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
(ap21)[cre 1; rem 0; act 0; pas 0; co 1; ci 1; ref reu 0; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 1; avai 0; unav 1; cp hig 1; ac cur 1; ac avg 0; ac hig 1; co del 168; co tot 1; res req 1; fai res 0; fai rec 0; h avai 1; h unav 1; lea co 0; psc acc 0; psc add 0; psc csi 0; psc del 0; psc hit 0; psc mis 0; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
[C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] setRequestInfoPrefix() : extra [GET with 5 parameters (partial request true) (initial render false) (postback true)]
[C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
[C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
[C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
(ap21)[cre 1; rem 0; act 0; pas 0; co 2; ci 2; ref reu 1; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 1; avai 0; unav 1; cp hig 1; ac cur 1; ac avg 0; ac hig 1; co del 168; co tot 1; res req 1; fai res 0; fai rec 0; h avai 1; h unav 1; lea co 0; psc acc 2; psc add 2; psc csi 2; psc del 0; psc hit 0; psc mis 2; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] setRequestInfoPrefix() : extra [POST with 55 parameters (partial request false) (initial render false) (postback true)]
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onNewConstruction() : [(am502) SecondAppModuleImpl_154 (not root) parent = (null)]
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onActivate() : [(am502) SecondAppModule (is root)](session version 11.1.1.61.92 oracle.jbo.server.SessionImpl@8add89)
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onCreate() : [(am502) SecondAppModule (is root)]
########SecondAppModuleImpl.create() called. AM isRoot() = true
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterConnect() : [(am502) SecondAppModule (is root)]
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onPrepareSession() : [(am502) SecondAppModule (is root)]
########SecondAppModuleImpl.prepareSession() called. AM isRoot() = true
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onPassivateState() : 5 : [(am502) SecondAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
(ap21)[cre 1; rem 0; act 0; pas 0; co 3; ci 3; ref reu 2; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 2; avai 0; unav 2; cp hig 2; ac cur 2; ac avg 0; ac hig 2; co del 122; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 2; psc add 2; psc csi 2; psc del 0; psc hit 0; psc mis 2; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
[C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterRequest() : 2 : ApplicationPool = onesizeonerootamapp.model.SecondAppModuleLocal
(ap22)[cre 1; rem 0; act 0; pas 0; co 1; ci 1; ref reu 0; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 2; avai 0; unav 2; cp hig 2; ac cur 2; ac avg 0; ac hig 2; co del 122; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 2; psc add 2; psc csi 2; psc del 0; psc hit 0; psc mis 2; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
[C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] setRequestInfoPrefix() : extra [GET with 5 parameters (partial request true) (initial render false) (postback true)]
[C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
[C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onPassivateState() : 5 : [(am502) SecondAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
[C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
(ap21)[cre 1; rem 0; act 0; pas 0; co 3; ci 3; ref reu 2; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 2; avai 0; unav 2; cp hig 2; ac cur 2; ac avg 0; ac hig 2; co del 122; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 4; psc add 4; psc csi 4; psc del 0; psc hit 0; psc mis 4; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
[C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onAfterRequest() : 2 : ApplicationPool = onesizeonerootamapp.model.SecondAppModuleLocal
(ap22)[cre 1; rem 0; act 0; pas 0; co 2; ci 2; ref reu 1; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 2; avai 0; unav 2; cp hig 2; ac cur 2; ac avg 0; ac hig 2; co del 122; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 4; psc add 4; psc csi 4; psc del 0; psc hit 0; psc mis 4; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]The "Always Begin New Transaction and Always Use Existing transaction" scenario results in logging like this:
[C][L][r1001][(ctx31) /faces : /secondIndex] setRequestInfoPrefix() : extra [GET with 3 parameters (partial request false) (initial render true) (postback true)]
[C][L][r1002][(ctx32) /faces : /secondIndex] setRequestInfoPrefix() : extra [GET with 3 parameters (partial request false) (initial render true) (postback true)]
[C][L][r1001][(ctx31) /faces : /secondIndex] onAfterRequest() : no ApplicationPools
[C][L][r1002][(ctx32) /faces : /secondIndex] onAfterRequest() : no ApplicationPools
[C][L][r1003][(ctx32) /faces : /secondIndex] setRequestInfoPrefix() : extra [POST with 5 parameters (partial request false) (initial render false) (postback true)]
[C][L][r1003][(ctx32) /faces : /secondIndex] onNewConstruction() : [(am501) FirstAppModuleImpl_1 (not root) parent = (null)]
[C][L][r1003][(ctx32) /faces : /secondIndex] onActivate() : [(am501) FirstAppModule (is root)](session version 11.1.1.61.92 oracle.jbo.server.SessionImpl@1d90a2c)
[C][L][r1003][(ctx32) /faces : /secondIndex] onCreate() : [(am501) FirstAppModule (is root)]
########FirstAppModuleImpl.create() called. AM isRoot() = true
[C][L][r1003][(ctx32) /faces : /secondIndex] onAfterConnect() : [(am501) FirstAppModule (is root)]
[C][L][r1003][(ctx32) /faces : /secondIndex] onPrepareSession() : [(am501) FirstAppModule (is root)]
########FirstAppModuleImpl.prepareSession() called. AM isRoot() = true
[C][L][r1003][(ctx32) /faces : /secondIndex] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
[C][L][r1003][(ctx32) /faces : /secondIndex] onNewConstruction() : [(am502) FirstAppModuleImpl_2 (not root) parent = (null)]
[C][L][r1003][(ctx32) /faces : /secondIndex] onSetParent() : 2 : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = (null)] parent = [(am501) FirstAppModule (is root)]
[C][L][r1003][(ctx32) /faces : /secondIndex] onCreate() : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]]
########FirstAppModuleImpl.create() called. AM isRoot() = false
[C][L][r1003][(ctx32) /faces : /secondIndex] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
[C][L][r1003][(ctx32) /faces : /secondIndex] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[C][L][r1003][(ctx32) /faces : /secondIndex] onNewShortId() : pNewShortId = ds81, pId = java:comp/env/jdbc/connHRDS - com.bea:ServerRuntime=DefaultServer,Name=OneSizeOneRootAMApp@connHR@connHR,ApplicationRuntime=OneSizeOneRootAMApp,Type=JDBCDataSourceRuntime
[C][L][r1003][(ctx32) /faces : /secondIndex] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
(ap21)[cre 1; rem 0; act 0; pas 0; co 1; ci 1; ref reu 0; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 1; avai 0; unav 1; cp hig 1; ac cur 1; ac avg 0; ac hig 1; co del 75; co tot 1; res req 1; fai res 0; fai rec 0; h avai 1; h unav 1; lea co 0; psc acc 0; psc add 0; psc csi 0; psc del 0; psc hit 0; psc mis 0; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
[L-before][L][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
[C][L][r1004][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] setRequestInfoPrefix() : extra [GET with 5 parameters (partial request true) (initial render false) (postback true)]
[C][L][r1004][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
[C][L][r1004][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[C][L][r1004][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
(ap21)[cre 1; rem 0; act 0; pas 0; co 2; ci 2; ref reu 1; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 1; avai 0; unav 1; cp hig 1; ac cur 1; ac avg 0; ac hig 1; co del 75; co tot 1; res req 1; fai res 0; fai rec 0; h avai 1; h unav 1; lea co 0; psc acc 2; psc add 2; psc csi 2; psc del 0; psc hit 0; psc mis 2; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
[L-before][L][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] setRequestInfoPrefix() : extra [POST with 55 parameters (partial request false) (initial render false) (postback true)]
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateStateForUndo() : [(am501) FirstAppModule (is root)] pId = null, pClientData = null, pFlags = unknown passivation flags (0)
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 2 : [(am501) FirstAppModule (is root)] pClientData = null, pFlags = PASSIVATE_UNDO_FLAG, PASSIVATE_TO_STACK_FLAG (40)
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateConnectionState() : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]] pDoc = (name = #document, doc elem = null), pParent = (name = CONN)
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateConnectionState() : [(am501) FirstAppModule (is root)] pDoc = (name = #document, doc elem = null), pParent = (name = CONN)
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPrepareForPassivation() : [(am501) FirstAppModule (is root)] pOut = (name = #document, doc elem = null) pParent = (name = AM)
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPrepareForPassivation() : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]] pOut = (name = #document, doc elem = null) pParent = (name = AM)
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 3 : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]] pDoc = (name = #document, doc elem = null), pParent = (name = AM)
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 3 : [(am501) FirstAppModule (is root)] pDoc = (name = #document, doc elem = null), pParent = (name = AM)
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onNewConstruction() : [(am503) SecondAppModuleImpl_155 (not root) parent = (null)]
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onSetParent() : 2 : [(am503) onesizeonerootamapp_model_SecondAppModule (not root) parent = (null)] parent = [(am501) FirstAppModule (is root)]
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onCreate() : [(am503) onesizeonerootamapp_model_SecondAppModule (not root) parent = [(am501) FirstAppModule (is root)]]
########SecondAppModuleImpl.create() called. AM isRoot() = false
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
(ap21)[cre 1; rem 0; act 0; pas 0; co 3; ci 3; ref reu 2; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 2; avai 1; unav 1; cp hig 2; ac cur 1; ac avg 0; ac hig 2; co del 79; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 3; psc add 3; psc csi 3; psc del 0; psc hit 0; psc mis 3; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
[L-before][L][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
[C][L][r1006][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] setRequestInfoPrefix() : extra [GET with 5 parameters (partial request true) (initial render false) (postback true)]
[C][L][r1006][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
[C][L][r1006][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[C][L][r1006][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
(ap21)[cre 1; rem 0; act 0; pas 0; co 4; ci 4; ref reu 3; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
(ds81)[cur cap 2; avai 1; unav 1; cp hig 2; ac cur 1; ac avg 0; ac hig 2; co del 79; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 5; psc add 3; psc csi 3; psc del 0; psc hit 1; psc mis 4; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]This seems to confirm more explicitly some of the observations in the blog post, and at the same time might add some additional insight into what the framework is doing.
Suggestions to improve such MyApplicationModuleListener approach (or an alternative approach) are welcome.
many thanks
Jan Verveckenfyi
Some additional features were added in the JAR files available
in http://www.consideringred.com/files/oracle/2013/MyApplicationModuleListenerApp-v0.05.zip
Like line numbers, or a queryOneRecord() method to support logging the database session SID, or a TaskFlowInfoHelper class to allow logging task-flow transaction options or DataControlFrame information.
If these JAR files are used, it results in the modified example application
at http://www.consideringred.com/files/oracle/2013/OneSizeOneRootAMApp-v0.03.zip
For the same scenarios (using OneSizeOneRootAMApp-v0.03.zip), the resulting logging can be found in these files:
- "maml-log-20130113-jdev111160-nctx.txt" : when using JDeveloper 11.1.1.6.0 and the chained "No Controller Transaction" scenario :
[0002][C][L][r1001][(ctx31) /faces : /firstIndex] logContextInformation() :
[0003]#{a_versionBean.appVersionInfo} = OneSizeOneRootAMApp v0.03 : oracle.jbo.Version = 11.1.1.61.92
[0007][C][L][r1002][(ctx32) /faces : /firstIndex] onAfterPrepareModel() : task-flow = (no current TaskFlowId) (unbounded task-flow pages)
[0008]transaction type = (no current TaskFlowId), DC scope = (no current TaskFlowId), DC frame = e1o4lmuw3_2, open transaction = null, is transaction dirty = false
[0044][C][L][r1005][(ctx32) /faces : /firstam-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/firstam-btf.xml#firstam-btf (no page-fragments)
[0045]transaction type = -No Controller Transaction-, DC scope = shared DataControlScopeType, DC frame = e1o4lmuw3_2, open transaction = null, is transaction dirty = false
[0046][C][L][r1005][(ctx32) /faces : /firstam-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/secondam-btf.xml#secondam-btf (no page-fragments)
[0047]transaction type = -No Controller Transaction-, DC scope = shared DataControlScopeType, DC frame = e1o4lmuw3_2, open transaction = null, is transaction dirty = true
[0057][C][L][r1005][(ctx32) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[0058](am501) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
[0060][C][L][r1005][(ctx32) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[0061](am502) SID = 27 for select sys_context('USERENV', 'SID') as sid from dual
Notice the transaction type and DataControl scope information per task-flow.
Notice the different database session SID values ("[0058](am501) SID = 41" and "[0061](am502) SID = 27") during the same request [r1005].
- "maml-log-20130113-jdev111230-nctx.txt" : when using JDeveloper 11.1.2.3.0 and the chained "No Controller Transaction" scenario :
[0002][C][L][r1001][(ctx31) /faces : /firstIndex] logContextInformation() :
[0003]#{a_versionBean.appVersionInfo} = OneSizeOneRootAMApp v0.03 : oracle.jbo.Version = 11.1.2.62.76
Notice the logged information seems similar to when, for the same application and scenario, JDeveloper 11.1.1.6.0 is used (above).
- "maml-log-20130113-jdev111160-tx.txt" : when using JDeveloper 11.1.1.6.0 and the "Always Begin New Transaction and Always Use Existing transaction" scenario :
[0002][C][L][r1001][(ctx31) /faces : /secondIndex] logContextInformation() :
[0003]#{a_versionBean.appVersionInfo} = OneSizeOneRootAMApp v0.03 : oracle.jbo.Version = 11.1.1.61.92
[0013][C][L][r1003][(ctx32) /faces : /secondIndex] onAfterPrepareModel() : task-flow = /WEB-INF/btf/firstam-tx-btf.xml#firstam-tx-btf (no page-fragments)
[0014]transaction type = Always Begin New Transaction, DC scope = isolated DataControlScopeType, DC frame = 1220j2l4q9_5, open transaction = 1220j2l4q9_5, is transaction dirty = false
[0017][C][L][r1003][(ctx32) /faces : /secondIndex] onCreate() : [(am501) FirstAppModule (is root)]
[0018](am501) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
[0025][C][L][r1003][(ctx32) /faces : /secondIndex] onCreate() : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]]
[0026](am502) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
[0056][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/secondam-tx-btf.xml#secondam-tx-btf (no page-fragments)
[0057]transaction type = Always Use Existing Transaction, DC scope = shared DataControlScopeType, DC frame = 1220j2l4q9_5, open transaction = 1220j2l4q9_5, is transaction dirty = true
[0060][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onCreate() : [(am503) onesizeonerootamapp_model_SecondAppModule (not root) parent = [(am501) FirstAppModule (is root)]]
[0061](am503) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
[0063][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[0064](am501) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
Notice that nested Application Module instances are created, resulting in one database session SID value per request.
- "maml-log-20130113-jdev111230-tx.txt" : when using JDeveloper 11.1.2.3.0 and the "Always Begin New Transaction and Always Use Existing transaction" scenario :
[0002][C][L][r1001][(ctx31) /faces : /secondIndex] logContextInformation() :
[0003]#{a_versionBean.appVersionInfo} = OneSizeOneRootAMApp v0.03 : oracle.jbo.Version = 11.1.2.62.76
[0052][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/firstam-tx-btf.xml#firstam-tx-btf (no page-fragments)
[0053]transaction type = Always Begin New Transaction, DC scope = isolated DataControlScopeType, DC frame = dw58co387_4, open transaction = dw58co387_4, is transaction dirty = false
[0059][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/secondam-tx-btf.xml#secondam-tx-btf (no page-fragments)
[0060]transaction type = Always Use Existing Transaction, DC scope = shared DataControlScopeType, DC frame = dw58co387_4, open transaction = dw58co387_4, is transaction dirty = true
[0070][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[0071](am501) SID = 38 for select sys_context('USERENV', 'SID') as sid from dual
[0073][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
[0074](am502) SID = 38 for select sys_context('USERENV', 'SID') as sid from dual
Notice that two root Application Module instances are used in the same request (and no nested instances), and both (am501) and (am502) report using the same database session SID value. That seems to be "Bruce" [1] at work.
Remember, it should not be difficult (and not intrusive) to configure similar logging for other ADF applications.
- [1] seeblog post "Task flows: Sayonara auto AM nesting in 11.1.2.0.0. Hello, ah, let's call it Bruce."
at http://one-size-doesnt-fit-all.blogspot.com.au/2011/08/task-flows-sayonara-auto-am-nesting-in.html
regards
Jan Vervecken -
i understand that we can't extend and substitute the root application module for a page. However, I am not sure how to tell if the AM I am working with is a root AM, actually I am not sure what a root AM is either. I tried extending PsrAM which is under oracle.apps.ap.payments.psr.server. It is the AM that is referred to from PsrPG.xml.
So how do I tell if this is the root AM?
Thanks for any help you can give!
DennisDennis
In addition to what chandra mentioned. Your saying that root AM cant be extended is not 100% correct
i understand that we can't extend and substitute the root application module for a pageWe can extend root AM as well provided that page doesnot have any LOV in it.
However as a workaround you can create a custom Application Module in Jdev and add it to page with the help of StackLayout Region.
Thanks
AJ -
Creating Root Application Module
Hi,
I'm trying to instantiate a root application module from another root application module,
that imports the first as a library jar file.
In the "Oracle ADF Model and Business Components API Reference" I have found the following sample code:
java.util.Hashtable env = new java.util.Hashtable();
// Add environment entries into env...
javax.naming.Context ic = new InitialContext(env);
String defName = ...;
oracle.jbo.ApplicationModuleHome home = ic.lookup(defName);
oracle.jbo.ApplicationModule am = home.create();
but I don't understand how to initialize the 'env' variable.
Can I have other samples and suggestions?
ArturoTry something like this:Hashtable prop = new Hashtable();
prop.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
prop.put(Context.PROVIDER_URL, “opmn:ormi://<server>:<container>/<application>”);
prop.put(Context.SECURITY_PRINCIPAL, “user”);
prop.put(Context.SECURITY_CREDENTIALS, “password”);
javax.naming.Context ic = new InitialContext(prop);You have to fill in <server> <container> and <application>.
Timo -
Help using C# application to connect to oracle database
I'm new to database.
I'm developing a C# GUI application in visual studio 2008 that is suppose to interact with oracle. After researching and trying out several sample codes, nothing works and I'm in desperate need of some help/advice/suggestions.
The simplest example I'm trying is to just get a button to run a simple SQL query. The code is:
private void button1_Click(object sender, EventArgs e)
string oradb = "Data Source=acme.gatech.edu;User Id=gtg880f;Password=******;";
OracleConnection conn = new OracleConnection(oradb); // C#
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "select Location_Name from warehouse where Location_name = 'atlanta'";
cmd.CommandType = CommandType.Text;
OracleDataReader dr = cmd.ExecuteReader();
dr.Read();
label1.Text = dr.GetString(0);
conn.Dispose();
I've installed many many version of oracle database and have included the Oracle.Data.Access under reference.
If I use putty and connect to acme.gatech.edu via port 22, I can type sqlplus / and run the query "elect Location_Name from warehouse where Location_name = 'atlanta'" and it'll work.
After some research, some say that if I can connect via sqlplus that means i can connect to the database but what do i need to implement to enable my c# code in visual studio to be able to do that.
I did a search on the forum but found nothing that matches this. In essence, I'm not sure what/how to specify such that I can connect to the acme.gatech.edu server and run sql commands.
Thanks,
Oky SabeniThere're two ways you can get data in and out of database using .NET
#1 System.Data.OracleClient namespace - it's .NET avail out of the box
#2 Oracle.DataAccess.Client - aka "ODP.NET"
Download: http://www.oracle.com/technology/software/tech/windows/odpnet/index.html
Or download Beta because as of today it's the only version which supports .NET "TransactionScope" (I just tested seems like still it is NOT working Re: 10g Express + ODP.NET (version 2.111.6.20) > support TransactionScope? http://www.oracle.com/technology/software/tech/windows/odpnet/index1110710beta.html
QuickStart: http://www.installationwiki.org/ODP.NET_Getting_Started_Guide
Also there's a doc under Start menu>Programs>Oracle - OraOdac11g_BETA_home>Application Development>"Oracle Data Provider for .NET Developer's Guide"
It's worth reading just scroll down quick for code fragment.
Anyway here's two small examples:
Example 1: System.Data.OracleClient (Using library from M$)
* First you'll need to add reference to "System.Data.OracleClient".
IDbFactory oDbFactory = DbProviderFactories.GetFactory("System.Data.OracleClient");
IDbConnection oConn = oDbFactory.CreateConnection();
oConn.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;";
// Or ...
oConn = new System.Data.OracleClient.OracleConnection("Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;");
Example 2: ODP.NET from Oracle
IDbFactory oDbFactory = DbProviderFactories.GetFactory("Oracle.DataAccess.Client");
IDbConnection oConn = oDbFactory.CreateConnection();
oConn.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;";
// Or ...
oConn = new Oracle.DataAccess.Client.OracleConnection("Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;");
string strSQL = "... SQL statement...";
int nPersonId = 0;
string strFirstName = null;
Person oPerson = null;
string strSQL = "SELECT Id FROM PERSON";
oCmd = oConn.CreateCommand();
oCmd.CommandText = strSQL;
oCmd.CommandType = System.Data.CommandType.Text;
IDataReader oRdr = oCmd.ExecuteReader();
while (oRdr.Read())
if (!Convert.IsDBNull(oRdr["Id"]))
nPersonId = (int) oRdr["Id"];
if (!Convert.IsDBNull(oRdr["FirstName"]))
strFirstName = (string)oRdr["FirstName"];
oPerson.Id = nPersonId;
oPerson.FirstName = strFirstName;
Example CREATE TABLE:
DECLARE
count_item int;
BEGIN
SELECT count(1) into count_item FROM user_sequences WHERE sequence_name = 'AUDITLOGSEQUENCE';
IF count_item > 0 THEN
begin
dbms_output.put_line('drop sequence AUDITLOGSEQUENCE');
EXECUTE IMMEDIATE ('DROP SEQUENCE AUDITLOGSEQUENCE');
end;
ELSE
dbms_output.put_line('no need to drop AUDITLOGSEQUENCE');
END IF;
EXECUTE IMMEDIATE 'CREATE SEQUENCE AUDITLOGSEQUENCE
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
INCREMENT BY 1
CACHE 20';
dbms_output.put_line('AUDITLOGSEQUENCE created');
SELECT count(1) into count_item FROM user_tables WHERE table_name = 'LOG';
IF count_item > 0 THEN
begin
dbms_output.put_line('drop table LOG');
EXECUTE IMMEDIATE ('DROP TABLE LOG');
end;
ELSE
dbms_output.put_line('no need to drop table LOG');
END IF;
EXECUTE IMMEDIATE '
CREATE TABLE LOG (
Id numeric(19,0) NOT NULL,
CreateDate timestamp default sysdate NOT NULL,
Thread varchar (510) NULL,
LogLevel varchar (100) NULL,
Logger varchar (510) NULL,
Message varchar (4000) NULL,
InnerException varchar (4000) NULL,
CONSTRAINT PK_LOG PRIMARY KEY (Id)
COMMIT;
dbms_output.put_line('table LOG created');
dbms_output.put_line('setup complete');
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('*** setup exception detected! ***');
dbms_output.put_line('error code: ' || sqlcode);
dbms_output.put_line('stack trace: ' || dbms_utility.format_error_backtrace);
RAISE_APPLICATION_ERROR(-20000, 'AuditTrail.oracle.tables.sql - install failed');
END;
Before running script, make sure your account has permission (unless you're using SYS account of course). You'd probably need to know how to create user and granther right:
CREATE USER dev IDENTIFIED BY "devacc_@";
GRANT CREATE SESSION TO DEV;
GRANT DBA TO DEV;
Here's how you can run PL\SQL scripts in Oracle
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Apr 6 14:10:05 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect devvvy/"somepwd"
Connected.
SQL> set serveroutput on
SQL> @C:\dev\UnitTest\Util\Command\sql\Oracle\SetupSchema\xxxxx.oracle.tables.sql
1125 /
SQL> @C:\dev\Util\Command\sql\Oracle\SetupSchema\xxxxx.oracle.tables.data.only.sql
560 /
PL/SQL procedure successfully completed.
SQL> @C:\dev\Util\Command\sql\Oracle\SetupSchema\AuditTrail.oracle.tables.sql
54 /
PL/SQL procedure successfully completed.
SQL> COMMIT;
Remeber however:
(a) SQL*Plus does not like "&" in your SQL script. Do comment or string containing "&" should be taken out.
(b) password should not contain "@" because it's a special character in "CONNECT" command.
Alternative, download TOAD for Oracle - http://www.toadsoft.com/toad_oracle.htm
(c) After command, type "/" next line to get command executed.
(d) remember to COMMIT
REF for Oracle:
Oracle Official doc: http://www.oracle.com/pls/db111/portal.portal_db?selected=1&frame=
Oracle 11g configuration Guide: http://www.thegeekstuff.com/2008/10/oracle-11g-step-by-step-installation-guide-with-screenshots/
ODAC/ODP.NET QuickStart: http://www.installationwiki.org/ODP.NET_Getting_Started_Guide
ODP.NET versioning scheme: http://download.oracle.com/docs/html/E10927_01/InstallVersioningScheme.htm
SQLPlus basic: http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25108/xedev_sqlplus.htm#CJAGGHGE
PL\SQL:
Cheat sheet: http://en.wikibooks.org/wiki/Oracle_Programming/SQL_Cheatsheet
Reference:
http://www.rocket99.com/techref/oracle_plsql.html
http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
EXECUTE IMMEDIATE, DROP/CREATE TABLE: http://www.java2s.com/Code/Oracle/PL-SQL/Callexecuteimmediatetodroptablecreatetableandinsertdata.htm
Exception handling: http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/07_errs.htm
Named Block syntax: http://www.java2s.com/Tutorial/Oracle/0440__PL-SQL-Statements/Thestructureofanamedblock.htm
CREATE PROCEDURE: http://it.toolbox.com/blogs/oracle-guide/learn-plsql-procedures-and-functions-13030
Oracle DataType: http://www.ss64.com/orasyntax/datatypes.html
http://www.adp-gmbh.ch/ora/misc/datatypes/index.html
Oracle Sequence and Create table: http://www.java2s.com/Tutorial/Oracle/0100__Sequences/Usingasequencetopopulateatablescolumn.htm -
Java Application to connect to vdb3 database
Hi Folks,
I have to create a java application to connect to vdb3 oracle databse to support various transactions with menu options as below:
File menu(ALT F)
---Connect (ALT L)
---Exit (ALT E)
Data menu(ALT D)
---Query(ALT Q)
---Add Student(ALT A)
---Delete Student(ALT T)
---Update Student(ALT U)
Option menu(ALT O)
---Color(ATL C)
---Font (ATL N)
There is a STUDENT table with studid, firstname, lastname, major and age.
I have the following code for the GUI. I am getting the following errors. How do I go about from here? Please help.
Student.java:13: cannot find symbol
symbol : class ControlPanel
location: class Student
private ControlPanel controls;
^
Student.java:38: cannot find symbol
symbol: method GridLayout(int,int,int,int)
frame.add(panel, GridLayout(4,2,5,5));
^
Student.java:49: cannot find symbol
symbol : method addWindowListener(<anonymous java.awt.event.WindowAdapter>)
location: class javax.swing.JMenuItem
exititem.addWindowListener(
^
Student.java:69: cannot find symbol
symbol : method JMenuItem(java.lang.String)
location: class Student
JMenuItem queryItem = JMenuItem("Query");
^
Student.java:78: cannot find symbol
symbol : method showMessgaeDialog(<nulltype>,java.awt.Component,java.lang.String,int)
location: class javax.swing.JOptionPane
JOptionPane.showMessgaeDialog(null, add(queryoutput), "QUERY RESULTS", JOptionPane.INFORMATION_MESSAGE);
import javax.swing.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
public class Student extends JFrame
private JTextArea out;
private JDesktopPane desktop;
private JTextArea queryoutput;
private ControlPanel controls;
public Student()
super(" Student Database");
//container c = getContentPane();
desktop = new JDesktopPane();
add(desktop);
JMenu fileMenu = new JMenu("File");
fileMenu.setMnemonic('F');
JMenuItem connectItem = new JMenuItem("Connect");
connectItem.setMnemonic('L');
fileMenu.add(connectItem);
connectItem.addActionListener(
new ActionListener()
public void actionPerformed(ActionEvent event)
JInternalFrame frame = new JInternalFrame("Login", true, true, true, true );
MyPanel panel = new MyPanel();
frame.add(panel, GridLayout(4,2,5,5));
frame.pack();
desktop.add(frame);
frame.setVisible(true);
JMenuItem exititem = new JMenuItem("Exit");
exititem.setMnemonic('E');
fileMenu.add(exititem);
exititem.addWindowListener(
new WindowAdapter()
public void WindowClosing (WindowEvent event)
System.exit(0);
JMenuBar bar = new JMenuBar();
setJMenuBar(bar);
bar.add(fileMenu);
queryoutput = new JTextArea(5,20);
JMenu dataMenu = new JMenu("Data");
dataMenu.setMnemonic('D');
JMenuItem queryItem = JMenuItem("Query");
queryItem.setMnemonic('Q');
dataMenu.add(queryItem);
dataMenu.addSeparator();
dataMenu.addActionListener(
new ActionListener()
public void actionPerformed(ActionEvent event)
JOptionPane.showMessgaeDialog(null, add(queryoutput), "QUERY RESULTS", JOptionPane.INFORMATION_MESSAGE);
JMenuItem addstud = new JMenuItem("Add Student");
addstud.setMnemonic('A');
dataMenu.add(addstud);
dataMenu.addActionListener(
new ActionListener()
public void actionPerformed(ActionEvent event)
JMenuItem delstud = new JMenuItem("Delete Student");
addstud.setMnemonic('T');
dataMenu.add(delstud);
dataMenu.addActionListener(
new ActionListener()
public void actionPerformed(ActionEvent event)
JMenuItem updatestud = new JMenuItem("Update Student");
addstud.setMnemonic('U');
dataMenu.add(updatestud);
dataMenu.addActionListener(
new ActionListener()
public void actionPerformed(ActionEvent event)
JMenu options = new JMenu("Options");
options.setMnemonic('O');
JMenuItem color = new JMenuItem("Color");
addstud.setMnemonic('C');
options.add(color);
options.addActionListener(
new ActionListener()
public void actionPerformed(ActionEvent event)
JMenuItem font = new JMenuItem("Font");
addstud.setMnemonic('N');
options.add(font);
options.addActionListener(
new ActionListener()
public void actionPerformed(ActionEvent event)
class MyPanel extends JPanel
private JLabel L1;
private JLabel L2;
private JLabel L3;
private JTextField userid;
private JPasswordField pw;
private JTextField database;
private JButton ok;
private Connection connect;
private JTextArea output;
private String url;
public MyPanel()
L1 = new JLabel("User Id:");
add(L1);
userid = new JTextField(10);
add(userid);
L2 = new JLabel("Password:");
add(L2);
pw = new JPasswordField(10);
add(pw);
L3 = new JLabel("Database Name:");
add(L3);
database = new JTextField(10);
add(database);
ok = new JButton("OK");
add(ok);
ok.addActionListener(
new ActionListener()
public void actionPerformed(ActionEvent event)
try {
url = "jdbc:odbc:Student";
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
connect = DriverManager.getConnection( url );
output.append( "Connection successful\n" );
catch ( ClassNotFoundException cnfex ) {
// process ClassNotFoundExceptions here
cnfex.printStackTrace();
output.append( "Connection unsuccessful\n" +
cnfex.toString() );
catch ( SQLException sqlex ) {
// process SQLExceptions here
sqlex.printStackTrace();
output.append( "Connection unsuccessful\n" +
sqlex.toString() );
catch ( Exception ex ) {
// process remaining Exceptions here
ex.printStackTrace();
output.append( ex.toString() );
import javax.swing.*;
public class MainWindow
public static void main( String args[])
Student student = new Student();
student.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
student.setSize(500,200);
student.setVisible( true);
}Error messages tell you everything you need to know (usually).
Student.java:13: cannot find symbol
symbol : class ControlPanel
location: class Student
private ControlPanel controls;
^
This means that the compiler cannot find the class ControlPanel. Does it exists. Is it in the same directory as your other files. Has it compiled correctly.
Student.java:38: cannot find symbol
symbol: method GridLayout(int,int,int,int)
frame.add(panel, GridLayout(4,2,5,5));
^
This tells you it cannot find the method GridLayout. I presume you meant to have a new in front of it. Besides the layout manager code should have been done prior to this and your code should be
frame.add(panel);Student.java:49: cannot find symbol
symbol : method addWindowListener(<anonymous java.awt.event.WindowAdapter>)
location: class javax.swing.JMenuItem
exititem.addWindowListener(
^
Once again the method addWindowListener cannot be found. JFrame has this method not JMenuItem. Probably need an ActionListener.
Student.java:69: cannot find symbol
symbol : method JMenuItem(java.lang.String)
location: class Student
JMenuItem queryItem = JMenuItem("Query");
^
Once again the compiler thinks you are trying to call a method called JMenuItem. You forgot new.
Student.java:78: cannot find symbol
symbol : method showMessgaeDialog(<nulltype>,java.awt.Component,java.lang.String,int)
location: class javax.swing.JOptionPane
JOptionPane.showMessgaeDialog(null, add(queryoutput), "QUERY RESULTS", JOptionPane.INFORMATION_MESSAGE);
Spelling! -
Application that connects to multiple databases.
I am developing an application that performs many task, but one in particular is connecting to multiple databases and creating user accounts in each all with the push of a single button. I have tried putting connect statements in the trigger code but I don't get the desired results.
How would I get my application to switch database connections while in execution?
Please reply to the forum, or email me @ [email protected]
Thank you.
TravisHi
The only possible way which I could find for your requirement is that of DB Links. Establish DataBase Links among the multible databases, with which you want to work in one session. Peform all your actions through the DB Links. -
Jdeveloper 10g Failed to chekcout the application module connection problem
Hello friends,
I am using trying to simulate the demo of "Oracle Application Development Framework (Oracle ADF) declarative and visual J2EE development" given on the same site.
To do the same I just downloaded the Jdeveloper 10g and followed the steps given in the application.
While running the page1DataAction in StrutsPageFlow I got the following exception on my internet explorer.
500 Internal Server Error
JBO-30003: The application pool (model.AppModuleLocal) failed to checkout an application module due to the following exception:
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: java.lang.ClassCastException, msg=sun.jdbc.odbc.JdbcOdbcConnection
at oracle.jbo.JboException.<init>(JboException.java:343)
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1759)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2488)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:434)
at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:241)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:405)
at oracle.jbo.common.ws.WSApplicationModuleImpl.createWorkerApplicationModule(WSApplicationModuleImpl.java:1606)
at oracle.jbo.common.ws.WSApplicationModuleImpl.getCustomApplicationModule(WSApplicationModuleImpl.java:1584)
at oracle.adf.model.bc4j.DCJboDataControl.setDataProvider(DCJboDataControl.java:781)
at oracle.adf.model.bc4j.DCJboDataControl.<init>(DCJboDataControl.java:140)
at oracle.jbo.uicli.binding.JUApplication.<init>(JUApplication.java:94)
at oracle.jbo.uicli.binding.JUApplication.<init>(JUApplication.java:85)
at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:249)
at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:93)
at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:543)
at oracle.adf.model.servlet.ADFBindingFilter.initializeBindingContext(ADFBindingFilter.java:228)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:84)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:784)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:536)
## Detail 0 ##
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.ClassCastException, msg=sun.jdbc.odbc.JdbcOdbcConnection
at oracle.jbo.JboException.<init>(JboException.java:343)
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:524)
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1646)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2488)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:434)
at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:241)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:405)
at oracle.jbo.common.ws.WSApplicationModuleImpl.createWorkerApplicationModule(WSApplicationModuleImpl.java:1606)
at oracle.jbo.common.ws.WSApplicationModuleImpl.getCustomApplicationModule(WSApplicationModuleImpl.java:1584)
at oracle.adf.model.bc4j.DCJboDataControl.setDataProvider(DCJboDataControl.java:781)
at oracle.adf.model.bc4j.DCJboDataControl.<init>(DCJboDataControl.java:140)
at oracle.jbo.uicli.binding.JUApplication.<init>(JUApplication.java:94)
at oracle.jbo.uicli.binding.JUApplication.<init>(JUApplication.java:85)
at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:249)
at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:93)
at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:543)
at oracle.adf.model.servlet.ADFBindingFilter.initializeBindingContext(ADFBindingFilter.java:228)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:84)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:784)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:536)
## Detail 0 ##
java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcConnection
at oracle.jbo.server.OracleSQLBuilderImpl.isConnectionAlive(OracleSQLBuilderImpl.java:3168)
at oracle.jbo.server.ConnectionPool.getConnectionInternal(ConnectionPool.java:90)
at oracle.jbo.server.ConnectionPool.getConnection(ConnectionPool.java:65)
at oracle.jbo.server.ConnectionPoolManagerImpl.getConnection(ConnectionPoolManagerImpl.java:56)
at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:831)
at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1067)
at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:5286)
at oracle.jbo.server.DBTransactionImpl2.connect(DBTransactionImpl2.java:116)
at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:288)
at oracle.jbo.common.ampool.ApplicationPoolImpl.connect(ApplicationPoolImpl.java:3515)
at oracle.jbo.common.ampool.ApplicationPoolImpl.instantiateResource(ApplicationPoolImpl.java:2151)
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:515)
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1646)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2488)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:434)
at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:241)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:405)
at oracle.jbo.common.ws.WSApplicationModuleImpl.createWorkerApplicationModule(WSApplicationModuleImpl.java:1606)
at oracle.jbo.common.ws.WSApplicationModuleImpl.getCustomApplicationModule(WSApplicationModuleImpl.java:1584)
at oracle.adf.model.bc4j.DCJboDataControl.setDataProvider(DCJboDataControl.java:781)
at oracle.adf.model.bc4j.DCJboDataControl.<init>(DCJboDataControl.java:140)
at oracle.jbo.uicli.binding.JUApplication.<init>(JUApplication.java:94)
at oracle.jbo.uicli.binding.JUApplication.<init>(JUApplication.java:85)
at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:249)
at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:93)
at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:543)
at oracle.adf.model.servlet.ADFBindingFilter.initializeBindingContext(ADFBindingFilter.java:228)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:84)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:784)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:536)
Please help me.As i am new user please tell me Is there any path to be set.
ThankYou.CAN ANYONE HELP ME.
-
Oracle Application server connection pool and database links
I am using Oracle application server 10g with connection pools, the db used by the application connects to another oracle db using a database link. My question is when the application starts it creates 10 connections, does it also create x amount of database links as well?
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 -
Execute SQL after root application module is created
Hi friend
I override this method from Root appModule implementation
protected void afterConnect() {
super.afterConnect();
//I add this line to execute a query when appmodule get db connection
String statement = "ALTER SESSION SET CURRENT_SCHEMA='SCOTT';";
CallableStatement plsqlBlock = getDBTransaction().createCallableStatement(statement, 0);
plsqlBlock.execute();
This is right?, i want to alter schema in db session always.If it is a session specific initialization, you can try prepareSession() method as explained here.
http://adfcodebits.blogspot.in/2010/06/bit-21-overriding-preparesession-to-do.html
http://docs.oracle.com/cd/B31017_01/web.1013/b25947/bcservices006.htm -
Hallo,
I have problem finding where db connection is already started. Following Steve Muench example of Dynamic JDBC credentials I have registered DynamicJdbcBindingFilter with code like that:
session.setAttribute(Configuration.DB_USERNAME_PROPERTY, usrName);
session.setAttribute(Configuration.DB_PASSWORD_PROPERTY, pswd);
if (jdbcURL != null) {
session.setAttribute(Configuration.DB_CONNECT_STRING_PROPERTY,jdbcURL);
super.doFilter(request, response, chain);
session.setAttribute(LOGGEDIN_ATTR,NON_NULL_VALUE);
Just after successful logon I need to call db procedure which sets some application role to logging user (dbms_session.set_role). Where I have to put this code? Where is the first class where I can obtain db connection to do that?In the article "How to support dynamic JDBC credentials" on the last page you describe to we have to register the SessionCookie factory with the AM pool.
Do I have to configure each AM in our application? We have about ~30 AMs .... -
We use JDev Build JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013.
We have a scenario as follows
Model
1. We have a nested AM scenario which contains 2 view instances of the same View Object (EmployeeView) in the nested AM
View
1. URL Invokable Bounded Taskflow containing just one JSPX with transaction set as "Always Begin New Transaction - Not Sharing Data Controls"
2. Bounded Taskflow with JSFF with transaction set as "Use Existing Transaction If Possible - Sharing Data Controls"
3. (2) is dropped as a region in the Page in context of (1)
4. The JSPX page contains a Form intended to display details for EmpId = 105 along with (3)
5. The JSFF referenced in (2) contains another form intended to display details for EmpId = 185
Because, there are 2 different view instances in the RootAM > NestedAM of the same view object EmployeeView,
Expected Behaviour
1. JSPX page should display details for EmpId = 105
2. JSFF Region should display details for EmpId = 185
Noticed Behaviour (Buggy)
Both display details for EmpId = 100 (First Record in the table)
What are we missing here?
Sample demo app. (HR schema) demonstrating the issue
http://www.box.com/s/lr3ervdhnyg696tyoz6dI can see this working in 11.1.2.1.0. However same failed for the version you mentioned.
Logged a bug#13797593 to track this case. Please follow it up through Oracle Support -
BC4J/UIX: Multiple Application Modules / Database Connections
My UIX application must have access to two databases. One is the main database for the application and the other contains lookup information. The lookup database is shared by many applications of different types. I need to display values in the UIX page and also create a composite view from tables in each database.
My understanding of this is that a UIX page requires a root Application Module which can have nested application modules allowing construction of a complex application. It appears that a UIX page must be tied to the root Application Module and then the nested modules can be referenced and used later in the UIX page.
Can I create a root Application Module that contains a nested application module that connects to a different database? If so, are there limitations in building associations between the AM's that use different databases?
If this is possible, how do I do it? I have created separate projects: one for each of the databases I mentioned and one for the main application module in a separate project. I try to create a "New Business Components Package" and "EJB Entity Facades for existing Entity Beans". The two application modules do not appear. (I created jar files for each of them and referenced these as libraries in the root module project.) Is this the correct approach? I have not found documentation that shows me how to do this yet so I admit I could be completely off base.Okay, I figured out that I have to build all of the BC4J packages under the same project and that the EJB Entity Facades is not what I should be working with.
Maybe I will figure out the rest before too long.
Maybe you are looking for
-
Data Acquisition for Position Transducer
I just purchased an Analog Position Transducer from SpaceAge Control, and was wondering if anyone had any code to gather the data. I must admit i'm lost when it comes to this, I thought the transducer would come like an instron where you just plug it
-
After entering my pw at the login screen, I get a black screen This started after battery got fully drained accidentally. It has happened in the past after battery gets fully drained accidentally, and I have to reboot several times until it boots pro
-
Can you set a time range in the wiki calendar?
I think the wiki calendar is a great feature in 10.5 Server, however I am annoyed by one problem. I can't figure out a way to limit the time on a wiki to say 8am to 5pm. I would like to use this as a class calendar page on the wiki, but it is really
-
Apple tv mirroring no button updates ok
Apple tv mirroring missing
-
Hi, it is very simple q, i think we have labview 7 and 2 DAQ cards from NI. we are developing an labview application that communicate over DAQmx drivers with our daq cards. what's the best way to export our labview application so that it can runs on