Cmp entity not releasing db connections
How can I make sure cmp entity bean releases database connection to
the connection pool after some time in oc4j 9.0.2 (ejb 1.1)?
I am using ejb-location in orion-ejb-jar.xml as data-source.
max-connections="30" after 30 connections it starts timing out.
Is there something I have to do in my entities?
Thanks-
ak
How can I make sure cmp entity bean releases database connection to
the connection pool after some time in oc4j 9.0.2 (ejb 1.1)?
I am using ejb-location in orion-ejb-jar.xml as data-source.
max-connections="30" after 30 connections it starts timing out.
Is there something I have to do in my entities?
Thanks-
ak
Similar Messages
-
LMS 4.2 is not releasing SSH connections of the devices
Hello!
We have LMS opens SSH sessions to Nexus 5000 devices as part of some jobs.
These SSH connections are not being released by LMS as soon as jobs are completed, which leads the N5K devices to hang without any way of managing them remotely.
We see these connections as idle on the nexus devices (which also should kill these sessions, but this is not the issue).
We have found a known bug:
CSCty90928
LMS Pari jobs are not releasing SSH,telnet connections of the devices
Symptom:
Telnet/SSH connections are not released by LMS
Conditions:
Pari collections jobs are not releasing the connections after the Job completed
Workaround:
None
This bug is categorized as "2 – severe" and is in "Open (Postponed)" status.
I have a few questions, if anyone can assist:
1.) What is the ETA to fix this bug?
2.) Are there any other known bugs matching what we see (documented public bugs, with bug ID's, internal bugs or even undocumented bugs).
3.) Is there any released or unreleased (even yet to be tested by TAC) patch we can use that should fix the issue?
4.) Is there any way to adjust LMS idle timeout of SSH/Telnet sessions (I couldn't find it in the GUI, but maybe there is a way to change this parameter using a perl script or modifying one of LMS properties files)?
Thanking in advance, Udi Dahan.Hello Ehud
From N5k side we have submitted bug CSCty00044
Currently there is no fix for it and our debelopment team is catively working on it and investigating the issue in the lab.
To get ETA for the release I would suggest you reach your account team and check with them how fast fixed release will be available.
HTH,
Alex -
Oci_close does not release the connection when using DRCP
Hello everyone,
we are currently testing the deplyment of DRCP with 11g. I have the whole thing setup (correctly to my best knowledge), but I am facing an issue. The call to oci_close does not seem to release the connection to the pool as I would expect and therefore we see similar behavior like we were getting without using the DRCP.
Our setup is using two RAC instances running 11.1.0.6.0, I am using PHP 5.1.6 with PECL installed oci8 1.3.4. The DRCP pool is configured and started, each with 100 max servers.
When the webserver is idle it looks, well, idle.
SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;
INST_ID NUM_BUSY_SERVERS
1 0
2 0
The script is as simple as it gets:
<?php
$c = oci_pconnect('scott','tiger','IWPPOOLED');
$s = oci_parse($c, 'select * from emp');
$r = oci_execute($s, OCI_DEFAULT);
oci_close($c);
sleep(30);
?>
What I would expect is that the script would connect to the pool, do the work for a tiny moment and then release the connection for usage by other script.
But after I point the browser to the script, I get a 30 second loading time (as expected) but the server is busy all the time, like this:
SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;
INST_ID NUM_BUSY_SERVERS
1 0
2 1
After the 30 second sleep, it is released and busy servers are back to 0.
If I load the server with ab using 256 connections:
ab -n 1000000 -c 256 -k http://mywebserver/ocitest.php
the pool is maxed out and the connects are stalling:
SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;
INST_ID NUM_BUSY_SERVERS
1 95
2 95
My network config for this service is following:
IWPPOOLED =
(DESCRIPTION =
(LOAD_BALANCE=ON)
(FAILOVER=ON)
(ADDRESS = (PROTOCOL = tcp)(HOST = 10.1.16.33)(PORT = 1521))
(ADDRESS = (PROTOCOL = tcp)(HOST = 10.1.16.34)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = IWP)
(SERVER=POOLED)
(FAILOVER_MODE=
(TYPE=SELECT)
(METHOD=BASIC)
(RETRIES=5)
(DELAY=3)
The phpinfo() look like this:
OCI8 Support enabled
Version 1.3.4
Revision $Revision: 1.269.2.16.2.38.2.20 $
Active Persistent Connections 1
Active Connections 1
Oracle Instant Client Version 11.1
Temporary Lob support enabled
Collections support enabled
Directive Local Value Master Value
oci8.connection_class IWPAPP IWPAPP
oci8.default_prefetch 100 100
oci8.events On On
oci8.max_persistent -1 -1
oci8.old_oci_close_semantics Off Off
oci8.persistent_timeout -1 -1
oci8.ping_interval -1 -1
oci8.privileged_connect Off Off
oci8.statement_cache_size 20 20
I am using the instant client for 11g
Any ideas?
Thanks!
MichalDon't forget to use oci_free_statement($s); See "Closing Oracle Connections" in The Underground PHP and Oracle Manual. (I was just simplifying this example today for the next release of the manual).
You may also see the "dedicated optimization", where a pooled server in a non- maxed-out pool is retained (unless needed by another PHP process) under the assumption that the initial PHP process might become active again. See http://www.oracle.com/technology/tech/php/pdf/php-scalability-ha-twp.pdf
Feel free to email me offline (see my profile) if there are questions/data you don't want to post.
cj
Edited by: cj2 on Oct 16, 2008 8:12 AM -
EJB3 : suspend JTA transaction does not release the connection in the XA DS
Hi all,
I did a test and after suspending a JTA transaction I note that in the xa datasource the activeconnection = 1.
So is it normal because I was thinking that when I suspend the transaction the teh connection is released and then after a transaction resume I could continue the transaction with another connection of the xa datasource ?
Thank you for all..
Christophe.It's a long time ago, but did you ever solve this problem?
I'm having the same issue with OSB writing to a WLS8.1 JMS queue.
I have a development OSB server which works fine.
Pete -
Oracle not releasing control/connections?
Hi,
I am running a .bat file that calls a wrapper java program that calls and waits for SqlPlus to return processing before the java program moves on to the next piece of code.
Oracle 10.0.2, java 1.5/1.6, Windows XP SP3, Windows Server 2003 SE are the versions/environments I have been able to run this on. Within my company there are no issues in calling sqlplus to process some sql file - containing multiple sql statements potentially - and return control back to java and complete without issue.
The problem is when my customer runs the exact same versions/env and scripts/classes etc from within his company then the sql file gets processed and the work gets done but control is never returned back to the java wrapper and so it ends up with a hanging sqlplus.exe and java.exe processes?
What is strange is that they can run a single statement sql file and it does return but as soon as a second line is added it does not.
Has anyone come across this before?
I have asked for their DBA's to get involved and try start tracing the connections going in and see what is happening but I wanted to ask around and see if anyone had come across this before.
So to sum up, same versions of desktops,java,oracle etc but works for me and not client. Only major difference is the DB's we are connecting to.
Thanks!Yes, bar the minor versions.
I have tested locally on 1.5 and 1.6 , while the customer is running 1.6. -
File Adapter creating huge connections and not releasing.
Hi,
We see high no. of current connections in file adapter from weblogic console against eis/HAFileAdapter under deployments -> fileadapter -> monitoring -> Outbound Connection Pools and are concerned about the same. It seems like fileadapter is not releasing the connection and hence no. of connections are piling up over a days and depending upon the transactions. coz after a restart the values comes down from 36000 to 10 ( which is default initial connection).
But when i see at the datasource level i don't see that much number of active connections. Need to know why this is happening and is this behavior is expected?
We are using SOA 11g PS2
Below is the deployment plan for fileadpater in use:
<?xml version='1.0' encoding='UTF-8'?>
<deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd" global-variables="false">
<application-name>connectors</application-name>
<variable-definition>
<variable>
<name>ConfigProperty_controlDir_Value_12732617703910</name>
<value>/var/opt/soa_nfs/data/SOA_PRD_DOMAIN/config/FileAdapter</value>
</variable>
<variable>
<name>ConfigProperty_outboundLockTypeForWrite_Value_12737938820080</name>
<value>oracle</value>
</variable>
<variable>
<name>ConnectionInstance_eis/HAFileAdapter1_JNDIName_13010279387490</name>
<value>eis/HAFileAdapter1</value>
</variable>
<variable>
<name>ConfigProperty_controlDir_Value_13010283495591</name>
<value>/var/opt/soa_nfs/data/SOA_PRD_DOMAIN/config/FileAdapter</value>
</variable>
<variable>
<name>ConfigProperty_inboundDataSource_Value_13010283655032</name>
<value>jdbc/SOADataSource</value>
</variable>
<variable>
<name>ConfigProperty_outboundDataSource_Value_13010283782973</name>
<value>jdbc/SOADataSource</value>
</variable>
<variable>
<name>ConfigProperty_outboundDataSourceLocal_Value_13010283877514</name>
<value>jdbc/SOALocalTxDataSource</value>
</variable>
<variable>
<name>ConfigProperty_outboundLockTypeForWrite_Value_13010283941445</name>
<value>oracle</value>
</variable>
<variable>
<name>ConfigProperty_inboundDataSource_Value_13081683627140</name>
<value>jdbc/SOADataSource</value>
</variable>
<variable>
<name>ConfigProperty_outboundDataSource_Value_13081683875571</name>
<value>jdbc/SOADataSource</value>
</variable>
<variable>
<name>ConfigProperty_outboundDataSourceLocal_Value_13081684137432</name>
<value>jdbc/SOALocalTxDataSource</value>
</variable>
<variable>
<name>ConnectionInstance_eis/HAFileAdapter_Wedb_JNDIName_13369118887880</name>
<value>eis/HAFileAdapter_Wedb</value>
</variable>
<variable>
<name>ConfigProperty_controlDir_Value_13369119117411</name>
<value>/var/opt/soa_nfs/data/SOA_PRD_DOMAIN/config/FileAdapter</value>
</variable>
<variable>
<name>ConfigProperty_inboundDataSource_Value_13369119237302</name>
<value>jdbc/SOADataSource</value>
</variable>
<variable>
<name>ConfigProperty_outboundDataSource_Value_13369119486683</name>
<value>jdbc/SOADataSource</value>
</variable>
<variable>
<name>ConfigProperty_outboundDataSourceLocal_Value_13369119703484</name>
<value>jdbc/SOALocalTxDataSource</value>
</variable>
<variable>
<name>ConfigProperty_outboundLockTypeForWrite_Value_13369119820485</name>
<value>oracle</value>
</variable>
</variable-definition>
<module-override>
<module-name>FileAdapter.rar</module-name>
<module-type>rar</module-type>
<module-descriptor external="false">
<root-element>weblogic-connector</root-element>
<uri>META-INF/weblogic-ra.xml</uri>
<variable-assignment>
<name>ConfigProperty_controlDir_Value_12732617703910</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter"]/connection-properties/properties/property/[name="controlDir"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_outboundLockTypeForWrite_Value_12737938820080</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter"]/connection-properties/properties/property/[name="outboundLockTypeForWrite"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConnectionInstance_eis/HAFileAdapter1_JNDIName_13010279387490</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter1"]/jndi-name</xpath>
<origin>planbased</origin>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_controlDir_Value_13010283495591</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter1"]/connection-properties/properties/property/[name="controlDir"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_inboundDataSource_Value_13010283655032</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter1"]/connection-properties/properties/property/[name="inboundDataSource"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_outboundDataSource_Value_13010283782973</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter1"]/connection-properties/properties/property/[name="outboundDataSource"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_outboundDataSourceLocal_Value_13010283877514</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter1"]/connection-properties/properties/property/[name="outboundDataSourceLocal"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_outboundLockTypeForWrite_Value_13010283941445</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter1"]/connection-properties/properties/property/[name="outboundLockTypeForWrite"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_inboundDataSource_Value_13081683627140</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter"]/connection-properties/properties/property/[name="inboundDataSource"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_outboundDataSource_Value_13081683875571</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter"]/connection-properties/properties/property/[name="outboundDataSource"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_outboundDataSourceLocal_Value_13081684137432</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter"]/connection-properties/properties/property/[name="outboundDataSourceLocal"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConnectionInstance_eis/HAFileAdapter_Wedb_JNDIName_13369118887880</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter_Wedb"]/jndi-name</xpath>
<origin>planbased</origin>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_controlDir_Value_13369119117411</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter_Wedb"]/connection-properties/properties/property/[name="controlDir"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_inboundDataSource_Value_13369119237302</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter_Wedb"]/connection-properties/properties/property/[name="inboundDataSource"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_outboundDataSource_Value_13369119486683</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter_Wedb"]/connection-properties/properties/property/[name="outboundDataSource"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_outboundDataSourceLocal_Value_13369119703484</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter_Wedb"]/connection-properties/properties/property/[name="outboundDataSourceLocal"]/value</xpath>
</variable-assignment>
<variable-assignment>
<name>ConfigProperty_outboundLockTypeForWrite_Value_13369119820485</name>
<xpath>/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="eis/HAFileAdapter_Wedb"]/connection-properties/properties/property/[name="outboundLockTypeForWrite"]/value</xpath>
</variable-assignment>
</module-descriptor>
<module-descriptor external="false">
<root-element>connector</root-element>
<uri>META-INF/ra.xml</uri>
</module-descriptor>
<module-descriptor external="true">
<root-element>wldf-resource</root-element>
<uri>META-INF/weblogic-diagnostics.xml</uri>
</module-descriptor>
</module-override>
<config-root>/opt/soauser/products/soa11.1/Oracle_SOA1/soa/connectors/plan</config-root>
</deployment-plan>
-RohitHi Arik,
To answer your questions :
You are using HAFileAdapter in your processes JNDI defenitions? --Yes
Check in your HAFileAdapter Connection Pool if Shrinking Enabled is set to true. --Its set to true
I would recomend also to change the properties Test Connections On Reserve to true, and Test Frequency Seconds(900 is the default). --These properties are also in place
-Rohit -
AFP not releasing users client
We have a problem with our client (MacPro) which is using Leopard 10.5.7 (client).
We are using this Mac as a 'server' for our other Macs and MacBooks (total 7). They connect true Apple filesharing and mount several volumes from our 'client server MacPro).
The problem:
After some time we get the message that there are more connections then 10 to this MacPro.
We are having 7 Macs. So how is that possible?
We found a terminal command: netstat -f inet -n | grep ".548 "
And yes, there are more then 10 connections to this MacPro.
We think that this MacPro is holding the idle connections for a time and not releasing AFP connections. Of course after some (long) time they will be out.
Question: does anyone know a workaround for this problem?
Is it possible to disconnect idle connections from the list?
And is it a bug?
Peter TollenaarI have been researching your issue and I can only find references to OSX Server.
with AFP connections even when a user is idle they can be disconnected from the server but the server caches the connection so that the client can automatically reconnect. eg if a mac sleeps it can reconnect to the server when it wakes automatically.
I presume the AppleFileServer in leopard client does a similar thing as the AppleFileServer on my leopard server is the same version that is running on Leopard Client.
In leopard server you use the serveradmin command to configure the AFP server properties.
In leoapard client there is no built in preference panel you can use to configure this setting.
However if you use MacPilot from Koingo software you have many functions including configuring the advanced features of the apple file server. You can download and use this software free of charge for a trial period.
In the General tab of the MacPilot toolbar scroll down to Sharing(Server) and experiment with changing the 'Reconnect Flag' to 'None'.
I am unable to test this at my end so cannot guarantee that this is the fix.
Make a back up of /Library/Preferencs/com.apple.AppleFileServer.plist on the server before you make any changes. -
Crystal Report Viewer Not Releasing Oracle Database Connections
I have a very simple vb.net 3.5 web application that uses the Crystal Report viewer 2008 to open a report. My requirements are as follows:
1. Reports are built by another company and provided to us and used in a web environment
2. All reports contain parameter fields
3. The web application must be generic enough that a report can be added to a list and the user simply selects the report and provides database login information. The Crystal report viewer with handle the request for parameter values and prompt the user for their values.
4. All reports connect to an Oracle 10g server.
The above requirements have been meet and we have an extremely simple web application that runs the reports. It is working very well other than the crystal report viewer is not releasing the database connections. This is bad because the credentials are on a per user basis and that same user must login to a different oracle application simultaneously. They are being denied access because the credentials are already in use. We do not have control nor influence over the policies in use on the Oracle server. Ideally we would like to control the Crystal Report viewer so that it closes connections after use.
The web application code is:
Private Sub viewReports_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
If Not IsPostBack Then
ConfigureCrystalReport()
End If
End Sub
Private Sub ConfigureCrystalReport()
'Load the Crystal Report viewer with a report.
Try
Dim reportPath As String = Server.MapPath(Session("reportname"))
crViewer.ReportSource = reportPath
Catch ex As Exception
Response.Write(Server.MapPath(Session("reportname")) & "
" & ex.Message.ToString & "
" & ex.StackTrace.ToString)
End Try
End Sub
Can anyone shed some light on this topic? Thank youHello, Timothy;
By default, having the report in session will hold it open for 20 minutes.
If you create the report as a ReportDocument object you can take it out of session and release it more efficiently. That will release the connection.
Private Sub ConfigureCrystalReports()
If (Session("hierarchicalGroupingReport") Is Nothing) Then
hierarchicalGroupingReport = New ReportDocument()
hierarchicalGroupingReport.Load(Server.MapPath("Hierarchical Grouping.rpt"))
Session("hierarchicalGroupingReport") = hierarchicalGroupingReport
Else
hierarchicalGroupingReport = CType(Session("hierarchicalGroupingReport"), ReportDocument)
End If
myCrystalReportViewer.ReportSource = hierarchicalGroupingReport
End Sub
In the Form Unload of the Viewer:
'Take the report out of session
Session("hierarchicalGroupingReport") = Nothing
Session.Contents.Remove("hierarchicalGroupingReport")
'Clean up the ReportDocument object
hierarchicalGroupingReport.Close
hierarchicalGroupingReport.Dispose()
hierarchicalGroupingReport = Nothing
GC.Collect()
Elaine -
Weblogic Data source is not releasing connections
Hi All,
Weblogic JDBC data source is not releasing connection until JDBC connection is deleted and created again. Could you please let me know this is a database issue or weblogic jdbc driver issue. We are using weblogic 10.1. Please see the following xml for JDBC driver.
Although maximum connections are set to 300, it stills keeps increasing connections over 300. This issue is resolved only when jdbc data source is deleted and created again.
<?xml version='1.0' encoding='UTF-8'?>
<jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xsi:schemaLocation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd">
<name>abc_admin_STGNCB</name>
<jdbc-driver-params>
<url>jdbc:oracle:thin:@10.151.43.54:1521:STGNCB</url>
<driver-name>oracle.jdbc.OracleDriver</driver-name>
<properties>
<property>
<name>user</name>
<value>abc_admin</value>
</property>
<property>
<name>portNumber</name>
<value>1521</value>
</property>
<property>
<name>SID</name>
<value>STGNCB</value>
</property>
<property>
<name>serverName</name>
<value>10.151.43.54</value>
</property>
</properties>
<password-encrypted>{3DES}wc5vg5GIbPtt+b8vWY0i5Q==</password-encrypted>
</jdbc-driver-params>
<jdbc-connection-pool-params>
<initial-capacity>20</initial-capacity>
<max-capacity>300</max-capacity>
<capacity-increment>10</capacity-increment>
<connection-creation-retry-frequency-seconds>30</connection-creation-retry-frequency-seconds>
<statement-cache-size>200</statement-cache-size>
<pinned-to-thread>true</pinned-to-thread>
<identity-based-connection-pooling-enabled>true</identity-based-connection-pooling-enabled>
</jdbc-connection-pool-params>
<jdbc-data-source-params>
<jndi-name>jdbc/ABC_TX_DATASOURCE</jndi-name>
<jndi-name>jdbc/ABC_NON_TX_DATASOURCE</jndi-name>
<jndi-name>jdbc/ABC_TX_EVENT_DATASOURCE</jndi-name>
<jndi-name>jdbc/ABC_NON_TX_EVENT_DATASOURCE</jndi-name>
<jndi-name>jdbc/ABC_DATASOURCE</jndi-name>
<jndi-name>abc.cdb.DataSource</jndi-name>
<global-transactions-protocol>EmulateTwoPhaseCommit</global-transactions-protocol>
</jdbc-data-source-params>
</jdbc-data-source>
Edited by: bpenugon on Aug 24, 2010 8:02 AMThe root cause is pinned-to-thread is enabled. When the application finishes using the connection and calls connection.close(), WebLogic Server keeps the connection with the execute thread and does not return it to the connection pool. The connection pool maximum capacity is ignored when pinned-to-thread is enabled. So you saw the number of connections in connection pool keeps increasing over 300.
Set pinned-to-thread to false can solve the problem. -
Persistent search connection not released
Hi,
We are using DS6.1 and have set up two persistent search job using LDAP JDK4.1 to monitor some directory entry changes. During testing, we've found that client connections are not released on DS server when network problems caused the socket connection break. From the server, netstat shows tcp socket is still ESTABLISHED, since Psearch connections are not timed out by nsslapd-idletimeout, the only way to close those psearch connections are restarting server.
Is there any way we can close down these persistent search connections either by configuring DS parameters, or add implementation on programming level?
Anyone has experience using persistent search in production? Is it reliable?
Thanks,
JuliaYes, our psearch connections are indeed closed when an entry change triggers the DS server to write to those connections.
Now we just have to make sure there will be entry change to trigger connection clean up before our DS reaches nsslapd-maxpsearch.
Thank you. -
Error Deploying CMP Entity Bean
Hi,
I am new to Entity Beans and am trying to deploy a CMP Entity Bean without any success.
I did search this forum for similar issues and tried those suggestions as well but that has not helped. Was wondering if someone could help me out on this.
The Entity bean has 2 fields: name and description.
The ejb-jar.xml file for this bean is:
<enterprise-beans>
<entity>
<ejb-name>Product</ejb-name>
<home>example.cmp.ProductHome</home>
<remote>example.cmp.Product</remote>
<ejb-class>example.cmp.ProductBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>PRODUCTS</abstract-schema-name>
<cmp-field>
<field-name>name</field-name>
</cmp-field>
<cmp-field>
<field-name>description</field-name>
</cmp-field>
<primkey-field>name</primkey-field>
<query>
</query>
</entity>
</enterprise-beans>
The error that I get while deploying the bean is:
Error deploying EJB homes for: file:/C:/servers/oc4j1013/j2ee/home/applications/cmptest/cmptest.jar
java.lang.InstantiationException: Error looking up cmt-datasource at jdbc/OracleDS (name not found)
at com.evermind.server.ApplicationState.getDataSourceContainer(ApplicationState.java:384)
Error deploying file:/C:/servers/oc4j1013/j2ee/home/applications/cmptest/cmptest.jar
homes: Error looking up cmt-datasource at jdbc/OracleDS (name not found)
[java] [TopLink Severe]: 2005.04.17 10:22:20.156--ServerSession(28816172)--
Local Exception Stack:
[java] Exception [TOPLINK-7060] (TopLink (Oracle OC4J CMP) - 10g release 3(10.1.3.0) (Build 041129)): oracle.toplink.exceptions.ValidationException
[java] Exception Description: Cannot acquire data source [jdbc/OracleDS].
[java] Internal Exception: javax.naming.NameNotFoundException: jdbc/OracleDS not found
[java] at oracle.toplink.exceptions.ValidationException.cannotAcquireDataSource(ValidationException.java:208)
[java] at oracle.toplink.internal.ejb.cmp.oc4j.Oc4jNonJtaConnector.getOrCreateDataSource(Oc4jNonJtaConnector.java:62)
If anybody knows what the problem is please let me know.
Thanks in advance.
BhupenPlease note that the data-source has been re-architectured in 10.1.3 DP3 and you should have DataSource as follows:
<data-sources xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://xmlns.oracle.com/oracleas/schema/data-sources-10_1.xsd' schema-major-version='10' schema-minor-version='1'>
<managed-data-source connection-pool-name='Example Connection Pool' jndi-name='jdbc/OracleDS' name='OracleManagedDS' />
<connection-pool name='Example Connection Pool' >
<connection-factory factory-class='oracle.jdbc.pool.OracleDataSource' user='scott' password='tiger' url='jdbc:oracle:thin:@localhost:1521:orcl'>
</connection-factory>
</connection-pool>
</data-sources> -
How to use same transaction when calling CMP entity beans and DAO (JDBC)
We are currently using Weblogic 8.1 SP2 with an Oracle 10g database (using XA thin and non-XA drivers).
We have a session bean that invokes an entity bean and a DAO (data access object pattern) in order to add data in 2 separate tables (account and history). Rows are added to the first (account) table using a CMP Entity bean while inserts are done in the 2nd (history) table using a DAO. Here is some pseudo code:
addHistorySessionBean (trans-attribute="Required")
begin
Step #1 - call addAccountEntityBean (trans- attribute="Required")
Step #2 - call addHistoryDAO (get datasource, connection)
end
The 2nd table (history) has a foreign key constraint to ensure that the corresponding key exists in the first (account) table. Unfortunately, DAO inserts on the 2nd (history) table fail with a foreign key constraint violation (INTEGRITY CONSTRAINT VIOLATION - PARENT KEY NOT FOUND!) since they cannot see the row added to the 1st (account) table in step #1 by the CMP entity bean.
How does one ensure that all this is done in a single transaction ? It appears that the app server creates two seperate transactions (one for the session bean facade and the entity bean and a 2nd transaction (when we retrieve a connection using the same data source JNDI name) for the DAO.
A post on server side suggested using a "<resource-ref>" in the session bean to tie the two potentially separate transactions together, but that does not work for us. However, I am not sure if we are doing that correctly. After we define the resource ref in the session facade bean, do we use the resource ref "name" attribute to lookup the datasource or do we still lookup the datasource by JNDI name ? Do we need to define the resource-ref tag in the entity bean also ?
Does Weblogic allow using a single transaction for this type of a scenario ? How does one specify within Weblogic that the same transaction should be utilized by the entity bean and any subsequent DAOs?
People have also suggested that we defer constraint checking until the transaction(s) are committed but that sounds like a work acount without addressing this issue. Would postponing the constraint checking in Oracle cause any additional overhead ?
Any suggestions with specific examples or documentation on how to address this issue will be gratefully appreciated.Thanks for your suggestion. Unfortunately, this does not work since it appears that there are 2 separate transactions going on here. One, the original one initiated by the session bean and used by the entity bean and the other initiated by the DAO. Any other ideas appreciated.
Hi,
Try setting the delay-database-inserts tag to
ejbCreate in RDBMS descriptor file.
http://bernal/stage/wls/docs81/ejb/DDreference-cmp-jar
.html#1113981
vasanthi ramesh -
CMP Entity Bean with ejb-ql finder methods and INFORMIX database
Hi,
I have some CMP Entity Beans with finder methods defined in ejb-ql. In my ejb-jar, within <entity> definitions I have something like:
<entity>
<abstract-schema-name>BeanName</abstract-schema-name>
<cmp-field><field-name>fieldOne</field-name></cmp-field>
<cmp-field><field-name>fieldTwo</field-name></cmp-field>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>SELECT OBJECT(o) FROM BeanName o</ejb-ql>
</query>
<entity>
And in persistent.xml:
<db-properties>
<data-source-name>datasource_name</data-source-name>
</db-properties>
<entity-bean>
<ejb-name>BeanName</ejb-name>
<table-name>table_name</table-name>
<field-map key-type="NoKey">
<field-name>fieldOne</field-name>
<column><column-name>column_one</column-name></column>
</field-map>
<field-map key-type="NoKey">
<field-name>fieldTwo</field-name>
<column><column-name>column_two</column-name></column>
</field-map>
<finder-descriptor>
<method-name>findAll</method-name>
<method-params/>
</finder-descriptor>
Once deployed, on server side, I can found a java source file (with corresponding compiled class file) in path:
j2ee/cluster/server0/apps/companyName/MyEARApp/EJBContainer/temp/temp38837373733/route/to/package/
with names:
BeanName0_0pm.java
BeanName0_0PM.class
and the generated java file contains this code:
public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, javax.ejb.EJBException {
TransactionContext tc = pm.getTransactionContext();
Connection conn = null;
PreparedStatement pSt = null;
ResultSet ejb_rs = null;
int status = javax.transaction.xa.XAResource.TMSUCCESS;
try {
conn = pm.getConnectionForFindMethod();
pSt = conn.prepareStatement("SELECT \"O\".\"COLUMN_ONE\",\"O\".\"COLUMN_TWO\", FROM \"TABLE_NAME\" \"O\"");
ejb_rs = pSt.executeQuery();
I'm trying to call this method but it throws a SQLException when preparing the statement.
It seems that Informix does not like this SQL syntax because of upper case names, doble quotes on table alias, or something else.
When editing persistent.xml in netweaver, I can define the element <datasource-vendor> as ORACLE, SAPDB, MS_SQL_SERVER, DB2_UDB_AS400 or DB2_UDB_OS390 but INFORMIX is not an accepted value.
Is there any way to define how this SQL query is build?
Thanks in advance.The return type of the finder method defined in the remote home interface is either the entity bean's remote interface or a collection of objects implementing the entity bean's remote interface. The return type of the finder method defined in the local home interface is either the entity bean's local interface or a collection of objects implementing the entity bean's local interface
-
Problem in creating CMP Entity Bean - Pls Help
I am trying to build one simple project having jsps to get connected to CMP Entity Bean.
But while deploying I am getting the following error...
Nov 15, 2004 10:59:09... Info: End of log messages of the target system.
Nov 15, 2004 10:59:09... Info: ***** End of SAP J2EE Engine Deployment (J2EE Application) *****
Nov 15, 2004 10:59:09... Error: Execution of deployment action for "EntityCMPAppln" aborted:
Caught exception during application deployment from SAP J2EE Engine's deploy service:
java.rmi.RemoteException: Error occurred while starting application bcone.com/EntityCMPAppln and wait.
Reason: Complex error : server ID 6155350:Application bcone.com/EntityCMPAppln cannot be started, because it has hard reference to resource CONFIG_DB with type javax.sql.DataSource, but it is not active on the server.
(message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
Nov 15, 2004 10:59:09... Error: Deployment NOT successful for EntityCMPAppln
Nov 15, 2004 10:59:09... Info: SDM configuration: Do not automatically start/stop J2EE Engine. Do not restore state of J2EE Engine now.
Nov 15, 2004 10:59:09... Error: -
At least one of the Deployments failed -
Nov 15, 2004 11:05:16... Info: Request for Logon as admin accepted
===========================================
Nov 15, 2004 11:05:08... Info: = Starting to execute command 'remotegui' =
Nov 15, 2004 11:05:08... Info: ===============================================
Nov 15, 2004 11:05:10... Info: SDM started successfully.
Please tell me how to activate the CONFIG_DB reference in database. Or what Extra I have to do to run this example.
Regards,
Vivek OjhaDear Benny,
The code of the required files is pasted below....
Application.XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>EntityCMPAppln</display-name>
<description>EAR description</description>
<module>
<ejb>EntityCMPEjb.jar</ejb>
</module>
<module>
<web>
<web-uri>EntityCMPWeb.war</web-uri>
<context-root>/student</context-root>
</web>
</module>
</application>
Application-j2ee-engine.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
<application-j2ee-engine>
<provider-name>bcone.com</provider-name>
<fail-over-enable
mode="disable"/>
</application-j2ee-engine>
data-source-aliases.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data-source-aliases SYSTEM "data-source-aliases.dtd">
<data-source-aliases>
<aliases>
<data-source-name>${com.sap.datasource.default}</data-source-name>
<alias>STUDENTDB</alias>
</aliases>
</data-source-aliases>
ejb-j2ee-engine.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">
<ejb-j2ee-engine>
<enterprise-beans>
<enterprise-bean>
<ejb-name>StudentBean</ejb-name>
<resource-ref>
<res-ref-name>jdbc/STUDENTDB</res-ref-name>
<res-link>STUDENTDB</res-link>
</resource-ref>
<entity-props/>
</enterprise-bean>
</enterprise-beans>
</ejb-j2ee-engine>
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<entity>
<ejb-name>StudentBean</ejb-name>
<home>com.bcone.ejb.StudentHome</home>
<remote>com.bcone.ejb.Student</remote>
<ejb-class>com.bcone.ejb.StudentBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>StudentBean</abstract-schema-name>
<cmp-field>
<field-name>studentId</field-name>
</cmp-field>
<cmp-field>
<field-name>lname</field-name>
</cmp-field>
<cmp-field>
<field-name>standard</field-name>
</cmp-field>
<cmp-field>
<field-name>fyear</field-name>
</cmp-field>
<cmp-field>
<field-name>fname</field-name>
</cmp-field>
<primkey-field>studentId</primkey-field>
<resource-ref>
<res-ref-name>jdbc/STUDENTDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
</ejb-jar>
persistent.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE persistent-ejb-map SYSTEM "persistent.dtd">
<persistent-ejb-map>
<locking
type="Table"/>
<db-properties>
<data-source-name>CONFIG_DB</data-source-name>
<database-vendor
name="SAPDB"/>
</db-properties>
<entity-beans>
<entity-bean>
<ejb-name>StudentBean</ejb-name>
<table-name>TMP_STUDENTNEW</table-name>
<field-map
key-type="PrimaryKey">
<field-name>studentId</field-name>
<column>
<column-name>STUDENTID</column-name>
</column>
</field-map>
<field-map
key-type="NoKey">
<field-name>lname</field-name>
<column>
<column-name>LNAME</column-name>
</column>
</field-map>
<field-map
key-type="NoKey">
<field-name>standard</field-name>
<column>
<column-name>STANDARD</column-name>
</column>
</field-map>
<field-map
key-type="NoKey">
<field-name>fyear</field-name>
<column>
<column-name>FYEAR</column-name>
</column>
</field-map>
<field-map
key-type="NoKey">
<field-name>fname</field-name>
<column>
<column-name>FNAME</column-name>
</column>
</field-map>
</entity-bean>
</entity-beans>
<relationships/>
</persistent-ejb-map>
StudentBean.java
package com.bcone.ejb;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;
import javax.ejb.CreateException;
@abstractSchemaName StudentBean
@cmpVersion 2.x
@ejbHome <{com.bcone.ejb.StudentHome}>
@ejbPrimaryKey <{java.lang.String}>
@ejbRemote <{com.bcone.ejb.Student}>
@hasSimplePK true
public abstract class StudentBean implements EntityBean {
public void ejbLoad() {
public void ejbStore() {
public void ejbRemove() throws RemoveException {
public void ejbActivate() {
public void ejbPassivate() {
public void setEntityContext(EntityContext context) {
myContext = context;
public void unsetEntityContext() {
myContext = null;
private EntityContext myContext;
@primKeyField
public abstract String getStudentId();
public abstract void setStudentId(String studentId);
public abstract String getLname();
public abstract void setLname(String lname);
public abstract String getFname();
public abstract void setFname(String fname);
public abstract String getStandard();
public abstract void setStandard(String standard);
public abstract String getFyear();
public abstract void setFyear(String fyear);
Create Method.
public String ejbCreate(
String studentId,
String fname,
String lname,
String standard,
String fyear)
throws CreateException {
setStudentId(studentId);
setFname(fname);
setLname(lname);
setStandard(standard);
setFyear(fyear);
return null;
Post Create Method.
public void ejbPostCreate(
String studentId,
String fname,
String lname,
String standard,
String fyear) {
// TODO : Implement
StudentData.java
Created on Nov 14, 2004
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
package com.bcone.data;
@author Administrator
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
public class StudentData {
private String studentId;
private String fname;
private String lname;
private String standard;
private String fyear;
@return
public String getFname() {
return fname;
@return
public String getFyear() {
return fyear;
@return
public String getLname() {
return lname;
@return
public String getStandard() {
return standard;
@return
public String getStudentId() {
return studentId;
@param string
public void setFname(String string) {
fname = string;
@param string
public void setFyear(String string) {
fyear = string;
@param string
public void setLname(String string) {
lname = string;
@param string
public void setStandard(String string) {
standard = string;
@param string
public void setStudentId(String string) {
studentId = string;
student.jsp
<%@ page language="java" %>
<html>
<head>
<title>
Title
</title>
</head>
<body>
<form method="POST" action="WEBBOT-SELF" name="Student" onSubmit="">
<!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" ><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!webbot
bot="SaveResults" endspan -->
<br>
<a href="/student/manageStudent.jsp?action=add" method="post"> Create </a>
<a href="/student/manageStudent.jsp?action=modify" method="post"> Modify </a>
<a href="/student/manageStudent.jsp?action=delete" method="post"> Delete </a>
<br><br>
<table border="1" width="32%">
<tr>
<td width="39%">Student ID </td>
<td width="61%"><input type="text" name="studentId" size="20"></td>
</tr>
<tr>
<td width="39%">First Name</td>
<td width="61%"><input type="text" name="fname" size="20"></td>
</tr>
<tr>
<td width="39%">Last Name</td>
<td width="61%"><input type="text" name="lname" size="20"></td>
</tr>
<tr>
<td width="39%">Standard</td>
<td width="61%"><input type="text" name="standard" size="20"></td>
</tr>
<tr>
<td width="39%">Fiscal Year</td>
<td width="61%"><input type="text" name="fyear" size="20"></td>
</tr>
<tr>
<td width="39%" align="center"><input type="submit" value="Submit" name="submit"></td>
<td width="61%" align="center"><input type="reset" value="Reset" name="reset"></td>
</tr>
</table>
</form>
</body>
</html>
mamageStudent.jsp
<%@ page language="java"
import="javax.naming.,java.sql.,javax.sql,com.bcone.ejb."
%>
<html>
<head>
<title>
Manage Student
</title>
</head>
<body>
<h1>
</h1>
<jsp:useBean id="stu" class="com.bcone.data.StudentData" ></jsp:useBean>
<jsp:setProperty name="stu" property="*" />
<%
try {
InitialContext ctx = new InitialContext();
StudentHome home = (StudentHome) ctx.lookup("java:comp/env/StudentBean");
String str = request.getParameter("action");
if("action".equals(str)) {
Student rem = home.create(remote.setFname(stu.getStudentId(),stu.getFname(),stu.getLname(),stu.getStandard(),stu.getFyear());
out.println(stu.getStudentId() + "Student Created");
} else if ("modify".equals(str)) {
Student remote = home.findByPrimaryKey(stu.getStudentId());
remote.setFname(stu.getFname());
remote.setFname(stu.getLname());
remote.setFname(stu.getStandard());
remote.setFname(stu.getFyear());
out.println(stu.getStudentId() + "Student modified");
} else if ("delete".equals(str)) {
Student stu1 = home.findByPrimaryKey(stu.getStudentId());
stu1.remove();
out.println(stu.getStudentId() + "Student deleted");
} catch (Exception e) {
out.println("Exception e"+e.toString());
%>
</body>
</html>
Regards,
Vivek Ojha -
Help:How to manage relationships in CMP Entity beans
Hi everybody;
I am using Oracle JDeveloper 9i release 2 and Oracle 9i database.
How can I manage one-to-many and many-to-many relationships in a CMP Entity Bean, I tried to managed the relationships in code, calling the beans, searching for records, making loops and joining.
Is there a better way to manage the relationships with out doing this in code?
Because I think it is not good for performance.
Regards Franciscopublic void selectCurriculum(ValueChangeEvent event){
logger.info(event.getNewValue().getClass());
Integer id = (Integer) event.getNewValue();
Collection curriculums = curriculums().getCurriculums();
ObjectCurriculum curriculum = null;
for (Iterator iterator = curriculums.iterator(); iterator.hasNext();) {
ObjectCurriculum objectCurriculum = (ObjectCurriculum) iterator.next();
if(objectCurriculum.getId().equals(id)){
curriculum = objectCurriculum;
break;
curriculum().setWholeObject(curriculum);
logger.info("setting current curriculum");
no message is logged
Maybe you are looking for
-
I have a photo album in my apple tv but can't get the apple tv to use it as a screen saver. it is using older photos
-
how do I center text in a photobook? thank you
-
Need advice Imac G5 Intel Duo 2 Core 2ghz will not power up DEAD
Hi all. Hoping for some friendly advice. I have an Imac G" Intel Duo 2 Core about a year old or so. My adult son was using it. Never a single issue and a very mild user. He reformatted it the other night and turned it over to me because he got a new
-
Confused about editing RAW images on iPad
I just got a new 3rd generation iPad. I got it primarily to store, view, and edit RAW images captured by my Canon DLSR. My camera takes 12 megapixel images. I am able to download them from the camera to the iPad using the Apple Camera Connection Kit.
-
Hi, My BPM Suite 11g is missing something. I have run RCU 11.1.1.3, installed WLS 10.3.3, installed SOA Suite 11.1.1.2.0, run SOA Suite patch set 11.1.1.3.0, created a domain with (among others) Oracle BPM Suite. But my MDS only has a soa-infra parti