Connection object creation
Hello
We are developing a website using the java technologies.
We are not using the connection pooling for connecting to the database. We use a static connection object and calling it in all the pages.
Is there any other good method for connecting to a database?
Writing to memory purpose is storing memory
Static connection should not use for data entry operation (if there is any common insert, update or delete statement exists). If any one of the client gives a commit cases all the database entries of the particular connection will be committed. In the case of display purpose static connection will not cause any problem.
If u r requirement is for data entry then try to use one method.. Whenever user logged in create a unique id and create a connection for this particular user. Then store this connection as well as id in a static hashmap in servlet. This id should be attach in all the further requests for retrieving the connection..
If anymore clarification needed
Mail me
[email protected]
Similar Messages
-
Connection object creation error(ES55)
Dear Friends,
When I try to create a connection object using tcode ES55 I am getting an error "Alternative ID Not supported", Message E7045, "An alternative indicator is active in Customizing of the functional location. This functionality is not supported for connection objects and device locations".
If I deactivate at Functional Location Level, system asks activation settings are not maintained.
Can somebody guide me on this issue.
with regards,
DayanandDear william,
I am not able to execute tcode ES55, becoz if I activate alternate labeling, system throws an error to deactivate it. If I deactivate it system throws an error to activate it.
Please suggest how to overcome this. We are using IDES 800 only. Do we need to update any patches.
with regards,
Dayanand -
ISU Connection Object Creation
Hi,
I am trying to create a IS-U Connection Object using .Net Connector 2.0, but when i execute the function it creates the Functional Location in PM, but i need to create connection object inside IS-U, BAPI function provided by SAP allows me to create only Functional Location in PM, is it any way by which i can create IS-U Connection Object using NCOWay around is to execute the T-Code from .Net using rfc functions
-
Creating an IBase Component WITH Connection Object (ISU_CONNOBJ)
Hello
I want to create an IBase Component with relation to a Connection Object. I am able to create the first one (IBase Component) but I do not know how to create a Connection Object for the newly created IBase Component.
I am doing everything using the BOL framework and was unable to find a proper relation from IBase Component or Product to Connection Object.
Can you help me out?
regards
MateuszSolved!
Apparently after creating new IBase Component and new Product (assigned to the newly created IBase Component) it is required to execute transaction save and commit for the object of newly created Product. After that system sees newly created objects.
Required code (after creation of a new Product):
DATA:
lo_core TYPE REF TO cl_crm_bol_core,
lo_new_product TYPE REF TO cl_crm_bol_entity,
lo_factory TYPE REF TO cl_crm_bol_entity_factory,
lo_transaction TYPE REF TO if_bol_transaction_context.
lo_core = cl_crm_bol_core=>get_instance( ).
lo_factory = lo_core->get_entity_factory( 'Product' ).
lo_new_product = lo_factory->create( )
lo_transaction = lo_core->get_transaction( iv_entity = lo_new_product ).
lo_transaction->save( iv_force_save = abap_true ).
lo_transaction->commit( ). -
CONNECTION OBJECT NOT REPLICATING IN IsU
Hello experts ,
i have problem regarding creation of techincal data ,
when i am creating connection object in crm web ui ,data is getting saved in crm , but it is not fetting replicated into isu .
althoug the bdoc are in green state .
awaiitng your valuable suggestion
regards
hemsapHave you created the MDT?
If no Please create the MDT with category CRMTECHCONNOBJ for connection object
Regards,
Siva -
Functional location not reflected in connection object
HI...
I created a functional location in the plant maintanence module..however when i try to check this from the connection object SAP gives me an error sayin the Location does not belon to IS type C(connection Object).
during FL creation i had specified the category as A (connection Object) and structure indicator as AO_GP (ISU defaults)...wat am i doing wrong..?HI MICK
I HOPE I HAVE FOUND UR ANSWER
JUST GOI TO
SPRO-SAP UTIL-MASTER DATACONNEC OBJECTBASIC SETTINGS-
HERE IN THIS SCREEN ENETR THE FOLLWONG ENTRUIES
IF U HAVE ONE DELETE ANDMAKENEW AS HERE
C AO_GP A
C is connection object
AO_GP str
A is fucnt location categ
make it
and u will get ur issues solved
kr
raj -
Error when run the transaction ES55 or ES56 of Connection Object
Dear Expert,
I like to say that our organzation is going to SAP 4.7 to 6.0. All the basis activity has been comlpleted & now its testing time.
I was faced the problem when create connection for Business partner. Actually when I write the t-code ES55 for creation of coonection Object in SAP menu path & press enter then show the error "system settings for the alternative labeling of functional locations have not been maintained in Customizing."
So I have activate the funclocation location alternative labelling. after that again run the T-Code es55 this time show the error "An alternative indicator is active in Customizing of the functional location. This functionality is not supported for connection objects and device locations"
Please suggest me how we customized the conection object 7 how will resolve the error.
Thanks & Regards,
DeepakHello Deepak,
please read note 964931:
These alternative labeling systems are not provided with the standard
product for the IS-U connection object and device location.
If you want to use alternative labeling systems for the IS-U connection
object and device location, SAP recommends a remote consulting.
Regards
Olivia -
Oracle 8i Lite: Command Object Creation Failed
Hi Everyone,
I use Windows XP everything works except navigator and I get the message that Command Object Creation Failed
Does Anyone know how to fix this and I have to use 8i Lite as it for a school database project
Thanks in advance for everyone's help
J SHi. I know this response is too many years late, but I'm putting it in case someone (like me a few days ago) needs to connect to a legacy server using legacy tools:
This error is caused by the installer, sometimes it does not adequately register the OLE/COM objects provided in nav8cmd.dll
So, to correct it:
- open a command window
- change to the directory where the navigator program files reside (In my case c:\orant\bin)
- type the following command: regsvr32 nav8cmd.dll
You should receive a message that the DLL was correctly registered. After that you can use the navigator without problems.
Cheers. -
CRM IBASE mismatch for Connection object - premise
Hi Experts,
In our ECC system we have a two connection objects connected to two different premises. While in CRM if I go to IBASE of Connection object 1 we get both premises attached to it and the connection object 2 does not show any premises. I would request help in correcting this. I am very new to CRM and have little knowledge of how this works.
Thanks in Advance,
HiteshSolved!
Apparently after creating new IBase Component and new Product (assigned to the newly created IBase Component) it is required to execute transaction save and commit for the object of newly created Product. After that system sees newly created objects.
Required code (after creation of a new Product):
DATA:
lo_core TYPE REF TO cl_crm_bol_core,
lo_new_product TYPE REF TO cl_crm_bol_entity,
lo_factory TYPE REF TO cl_crm_bol_entity_factory,
lo_transaction TYPE REF TO if_bol_transaction_context.
lo_core = cl_crm_bol_core=>get_instance( ).
lo_factory = lo_core->get_entity_factory( 'Product' ).
lo_new_product = lo_factory->create( )
lo_transaction = lo_core->get_transaction( iv_entity = lo_new_product ).
lo_transaction->save( iv_force_save = abap_true ).
lo_transaction->commit( ). -
Hi ,
I am trying to change connection object details and using the ISU_S_CONNOBJ_CHANGE function module
it is not updating the values .Kindly suggest!!!!1
Thanks,
Pradeep.Hi,
Please call function module ISU_S_CONNOBJ_PROVIDE to populate Y_OBJ and Y_AUTO.
You would first need to populate the fields which need to be updated in X_AUTO fields and have the OK CODE as 'SAVE'. Then update Y_OBJ parameters as per requirement and pass the values to function module ISU_S_CONNOBJ_CHANGE.
Alternatively, I suggest to use Master Data Template. Please visit Master Data Template in ISU for more details.
You can use Master Data Category CONNOBJ for creating Master Data Template. (Transaction code to access it is EPRODCUST). After creation, test your Master Data Template. Then you need to call ISU_PRODUCT_IMPLEMENT with your template.
Please let me know if this was useful.
Regards,
Avinash -
Connection Objects / Functional Location Number ranges Issue
Hi ALL
Number range object: ISU_EHAU is related to Connection Object / Functional Location creation.
But my client wants to create Connection Object number and functional Location number with different number range series number.
Can any one guide me how to proceed?
Thanks In Advance
KKHi,
As Connection Object & Device Location are functional locations so you have to be sure to map it to the same structure as defined in PM.
The structure can be defined in PM through this path:
Plant Maintenance and Customer Service -> Master Data in Plant Maintenance and Customer Service -> Technical Objects -> Functional Locations -> Create Structure Indicator for Reference Locations/Functional Locations
Here you can define your own edit mask for your structure for the functional location.
according to the error message you got the Edit mask defined in your system must be XXXX-XXX-AA-NN.(kindly Check).
X means you can enter both number and letters.
A means only letters can be entered.
N means only numbers can be entered.
So try something like 1ABC-1A-QW-77(again check with the old number range that was defined)
You can change the edit mask to 'XXXXXXX......XXXXXXXX'.(full field filled with X).
and then I guess you can use the number range you have defined(as you wrote above) in the Connection Object number range(Object : ISU_EHAU)
Kindly revert back for any clarifications.
Regards,
Rakesh..
Edited by: Rakesh Dasgupta on Feb 12, 2011 2:41 PM -
Frequent Object Creation vs. synchronized
HI all,
I'm just looking to prompt a discussion I can learn from. Apologies if I'm missing something.
Having just read the excellent articles over at:
http://www-106.ibm.com/developerworks/java/library/j-threads1.html
http://www-106.ibm.com/developerworks/java/library/j-threads2.html
http://www-106.ibm.com/developerworks/java/library/j-threads3.html
I was left wondering about the (largely unmentioned) trade-off between object creation and use of synchronization.
If a particular part of a given system is heavily accessed then one might consider instantiating, and caching references to, components in an initialisation stage. In a multithreaded environment, this can obviously pose a problem.
If these components aren't threadsafe then at some point use will have to be made of a synchronized block, unless the unsafe components are instantiated for every thread.
The articles do mention the overrated cost of synchronization - how does this compare with the cost of frequent object instantiation?
Thanks for your time,
JohnGWell, let's time it (test program below):
using no synchronization: 180 ms (baseline measurement, not thread safe)
using new: 1111 ms
using uncontended sync: 491 ms
using contended sync: 49531 ms
new is fast - ten million temporary object allocations and frees per second. A magnitude faster than in traditional malloc()/free() -based languages. new is rarely a performance problem in Java programs.
Uncontended locks are fast - twenty million per second.
Heavily contended locks slow you down. Way down. A second becomes a minute.
Don't try to optimize unless you have measured a real performance bottleneck.
Object pooling is unlikely to help. Exceptions being objects that are expensive to initialize and are created often (e.g. large buffers or arrays, cryptographic engines that take time to initialize, or connections to external systems such as databases). You'll need to measure first if object creation really is the bottleneck.
public class t
static class Calculator
private int value;
void initialize(int n)
value = n;
int result()
return value * 2;
static class NewThread
extends Thread
int result;
public void run()
for (int n = 0; n < 1000 * 1000; n++) {
Calculator x = new Calculator();
x.initialize(n);
result += x.result();
static class SyncThread
extends Thread
static Calculator x = new Calculator();
int result;
public void run()
for (int n = 0; n < 1000 * 1000; n++) {
synchronized (x) {
x.initialize(n);
result += x.result();
// Not thread safe
static class BaselineThread
extends Thread
static Calculator x = new Calculator();
int result;
public void run()
for (int n = 0; n < 1000 * 1000; n++) {
x.initialize(n);
result += x.result();
public static void main(String args[])
throws Exception
int thread_count = 10;
for (int n = 0; n < 5; n++) {
Thread threads[] = new Thread[thread_count];
long start = System.currentTimeMillis();
for (int m = 0; m < thread_count; m++) {
// threads run consecutively, not in parallel
(threads[m] = new BaselineThread()).start();
threads[m].join();
long end = System.currentTimeMillis();
System.out.println("using no synchronization: " +
(end - start) + " ms");
for (int n = 0; n < 5; n++) {
Thread threads[] = new Thread[thread_count];
long start = System.currentTimeMillis();
for (int m = 0; m < thread_count; m++)
(threads[m] = new NewThread()).start();
for (int m = 0; m < thread_count; m++)
threads[m].join();
long end = System.currentTimeMillis();
System.out.println("using new: " + (end - start) + " ms");
for (int n = 0; n < 5; n++) {
Thread threads[] = new Thread[thread_count];
long start = System.currentTimeMillis();
for (int m = 0; m < thread_count; m++) {
// threads run consecutively, not in parallel
(threads[m] = new SyncThread()).start();
threads[m].join();
long end = System.currentTimeMillis();
System.out.println("using uncontended sync: " +
(end - start) + " ms");
for (int n = 0; n < 5; n++) {
Thread threads[] = new Thread[thread_count];
long start = System.currentTimeMillis();
for (int m = 0; m < thread_count; m++)
(threads[m] = new SyncThread()).start();
for (int m = 0; m < thread_count; m++)
threads[m].join();
long end = System.currentTimeMillis();
System.out.println("using contended sync: " +
(end - start) + " ms");
} -
Dynamic Connection Pool Creation Failing in a cluster
Hi,
I am trying to create a connection pool in a clustered environment. This connection
pool is created lazily behind a Stateless Session Bean. We first attempt to determine
whether, the connection pool exists using JdbcServices.poolExists(someName), and
create it if it does not exist. A failure occurs on creation because it looks
like the connection pool might have been created by a bean on a different weblogic
VM instance. Is there any way to dynamically create a connection pool and make
it visible to the whole cluster? Thanks in advance for any help. Michael Dolbear
Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Checking existence of connection pool
Content
ConnectionPool requested by user guest>
<Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Creating connection pool ContentConnectionPoo
l requested by user guest>
weblogic.common.ResourceException: weblogic.management.MBeanCreationException:
Start server side stack trace:
javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=JD
BCConnectionPool
at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:
2352)
at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:874)
at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanSer
verImpl.java:181)
at weblogic.management.internal.Helper.createMBean(Helper.java:376)
at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
ServerImpl.java:278)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
635)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
621)
at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
Impl.java:397)
at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.management.MBeanCreationException: - with nested exception:
[javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=J
DBCConnectionPool]
at weblogic.management.internal.Helper.createMBean(Helper.java:383)
at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
ServerImpl.java:278)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
635)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
621)
at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
Impl.java:397)
at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
- with nested exception:
[javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=J
DBCConnectionPool
Start server side stack trace:
javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=JD
BCConnectionPool
at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:
2352)
at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:874)
at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanSer
verImpl.java:181)
at weblogic.management.internal.Helper.createMBean(Helper.java:376)
at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
ServerImpl.java:278)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
635)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
621)
at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
Impl.java:397)
at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
at weblogic.jdbc.common.internal.ConnectionPool.dynaStartup(ConnectionPool.java:47
2)
at weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.java:727
at weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.java:709
at com.thc.ids.inf.framework.opf.rdbms.datastore.ConnectionPoolCreator.createConne
ctionPool(ConnectionPoolCreator.java:82)
at com.thc.ids.inf.framework.opf.datastore.DataStoreRepository.createConnectionPoo
lIfNonExistent(DataStoreRepository.java:211)
at com.thc.ids.inf.util.persistence.content.ConnectionPoolInitializer.createConnec
tionPoolIfNeeded(ConnectionPoolInitializer.java:48)
at com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.create
ConnectionPoolIfNeeded(Unknown Source)
at com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.getIma
ge(Unknown Source)
at com.thc.ids.inf.services.business.crs.ContentRetrievalService.getImage(Unknown
Source)
at java.lang.reflect.Method.invoke(Native Method)
at com.thc.ids.inf.util.reflection.MethodDescription.invokeMethod(MethodDescriptio
n.java:181)
at com.thc.ids.inf.util.reflection.MethodInvocation.invoke(MethodInvocation.java:7
9)
at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean.invoke(ServiceBean.java:
186)
at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl.invoke(Ser
viceBean_bjedmi_EOImpl.java:37)
at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl_WLSkel.inv
oke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
<Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Checking existence of connection
pool Content
ConnectionPool requested by user guest>
<Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Creating connection pool ContentConnectionPoo
l requested by user guest>
weblogic.common.ResourceException: weblogic.management.MBeanCreationException:
Start server side stack trace:
javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=JD
BCConnectionPool
at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:
2352)
at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:874)
at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanSer
verImpl.java:181)
at weblogic.management.internal.Helper.createMBean(Helper.java:376)
at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
ServerImpl.java:278)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
635)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
621)
at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
Impl.java:397)
at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.management.MBeanCreationException: - with nested exception:
[javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=J
DBCConnectionPool]
at weblogic.management.internal.Helper.createMBean(Helper.java:383)
at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
ServerImpl.java:278)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
635)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
621)
at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
Impl.java:397)
at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
- with nested exception:
[javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=J
DBCConnectionPool
Start server side stack trace:
javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=JD
BCConnectionPool
at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:
2352)
at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:874)
at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanSer
verImpl.java:181)
at weblogic.management.internal.Helper.createMBean(Helper.java:376)
at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
ServerImpl.java:278)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
635)
at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
621)
at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
Impl.java:397)
at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
at weblogic.jdbc.common.internal.ConnectionPool.dynaStartup(ConnectionPool.java:47
2)
at weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.java:727
at weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.java:709
at com.thc.ids.inf.framework.opf.rdbms.datastore.ConnectionPoolCreator.createConne
ctionPool(ConnectionPoolCreator.java:82)
at com.thc.ids.inf.framework.opf.datastore.DataStoreRepository.createConnectionPoo
lIfNonExistent(DataStoreRepository.java:211)
at com.thc.ids.inf.util.persistence.content.ConnectionPoolInitializer.createConnec
tionPoolIfNeeded(ConnectionPoolInitializer.java:48)
at com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.create
ConnectionPoolIfNeeded(Unknown Source)
at com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.getIma
ge(Unknown Source)
at com.thc.ids.inf.services.business.crs.ContentRetrievalService.getImage(Unknown
Source)
at java.lang.reflect.Method.invoke(Native Method)
at com.thc.ids.inf.util.reflection.MethodDescription.invokeMethod(MethodDescriptio
n.java:181)
at com.thc.ids.inf.util.reflection.MethodInvocation.invoke(MethodInvocation.java:7
9)
at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean.invoke(ServiceBean.java:
186)
at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl.invoke(Ser
viceBean_bjedmi_EOImpl.java:37)
at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl_WLSkel.inv
oke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)The only way to do it is using MBeans. You could search this newsgroup
for "JDBCConnectionPoolMBean" to get an idea of how it could be done.
Slava
P.S. http://search.bea.com/weblogic/gonews
"Mark Mortensen" <[email protected]> wrote in message
news:[email protected]...
>
Slava,
I am working with Mike on this issue and wanted to add some moreclarifications.
We have a two server cluster where one of the EJB's on one of the Managedservers
creates the connection pool. The problem comes in when a request comes tothe
second server in the cluster. The connection pool is created by the firstserver
but it is only assigned to the first server in the targets section on theconsole.
It isn't assigned to the cluster. Is there a way to programmaticallyassign the
pool to the cluster instead of just the server that created the pool?
-Mark
"Michael Dolear" <[email protected]> wrote:
Hi Slava,
Here is what I am doing. The code is spread across a couple of classes.
I am using
what was described in BEA's doc on dynamic connection pool creation.
I didn't
see anything about MBean apis required:
* Dynamically create a connection pool using
aConnectionPoolProperties.
Please
see ConnectionPoolCreator
* for the required properties that must be sent in.
* @param aConnectionPoolProperties
public synchronized void createConnectionPoolIfNonExistent(Properties
aConnectionPoolProperties)
throwsPersistenceFrameworkInitializationException
ConnectionPoolCreator tempPoolCreator;
Pool tempPool;
tempPoolCreator = new ConnectionPoolCreator();
tempPool =tempPoolCreator.getConnectionPool(aConnectionPoolProperties);
if (tempPool == null)
tempPoolCreator.createConnectionPool(aConnectionPoolProperties);
>>
* Create Connection pool given the properties that I have beenconfigured
with
* @return Pool
public Pool createConnectionPool(Properties aConnectionProperties)
throwsPersistenceFrameworkInitializationException
JdbcServices tempServices;
try
tempServices = this.lookupJdbcServices();
tempServices.createPool(aConnectionProperties);
returntempServices.getPool(aConnectionProperties.getProperty(CONNECTION_POOL_NAME)
catch (Exception e)
PersistenceFrameworkUtils.logException(e);
throw newPersistenceFrameworkInitializationException(e.getMessage());
* Answer a connectionPool or null.
* @return Pool
public Pool getConnectionPool(Properties aConnectionProperties)
throwsPersistenceFrameworkInitializationException
JdbcServices tempServices;
try
tempServices = this.lookupJdbcServices();
if (tempServices.poolExists(
aConnectionProperties.getProperty(CONNECTION_POOL_NAME)))
return tempServices.getPool(
aConnectionProperties.getProperty(CONNECTION_POOL_NAME));
else
return null;
catch (Exception e)
PersistenceFrameworkUtils.logException(e);
throw
newPersistenceFrameworkInitializationException(e.getMessage());
"Slava Imeshev" <[email protected]> wrote:
Hi Michael,
Could you show us the code? Without looking at the code
I can only say that JdbcServices.poolExists(someName)
returns true only in case the pool is up and running.
If the connection pool MBean was created but not assigned
a target, subsequent tries to create it would fail.
Regards,
Slava Imeshev
"Michael Dolbear" <[email protected]> wrote in message
news:[email protected]...
Hi,
I am trying to create a connection pool in a clustered environment.This
connection
pool is created lazily behind a Stateless Session Bean. We first
attempt
to determine
whether, the connection pool exists usingJdbcServices.poolExists(someName), and
create it if it does not exist. A failure occurs on creation becauseit
looks
like the connection pool might have been created by a bean on a
different
weblogic
VM instance. Is there any way to dynamically create a connection pooland
make
it visible to the whole cluster? Thanks in advance for any help.
Michael
Dolbear
Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Checking existence ofconnection pool
Content
ConnectionPool requested by user guest>
<Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Creating connection poolContentConnectionPoo
l requested by user guest>
weblogic.common.ResourceException:weblogic.management.MBeanCreationException:
Start server side stack trace:
javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=JD
BCConnectionPool
at
com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:1
34
at
com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.
ja
va:
2352)
at
com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:
87
4)
at
weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBe
an
Ser
verImpl.java:181)
atweblogic.management.internal.Helper.createMBean(Helper.java:376)
atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at
weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
MB
ean
ServerImpl.java:278)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
635)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
621)
at
weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
nH
ome
Impl.java:397)
atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
:2
2)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.management.MBeanCreationException: - with nested exception:
[javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=J
DBCConnectionPool]
atweblogic.management.internal.Helper.createMBean(Helper.java:383)
atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at
weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
MB
ean
ServerImpl.java:278)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
635)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
621)
at
weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
nH
ome
Impl.java:397)
atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
:2
2)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
- with nested exception:
[javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=J
DBCConnectionPool
Start server side stack trace:
javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=JD
BCConnectionPool
at
com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:1
34
at
com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.
ja
va:
2352)
at
com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:
87
4)
at
weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBe
an
Ser
verImpl.java:181)
atweblogic.management.internal.Helper.createMBean(Helper.java:376)
atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at
weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
MB
ean
ServerImpl.java:278)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
635)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
621)
at
weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
nH
ome
Impl.java:397)
atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
:2
2)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
at
weblogic.jdbc.common.internal.ConnectionPool.dynaStartup(ConnectionPool.ja
va
:47
2)
at
weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.jav
a:
727
at
weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.jav
a:
709
at
com.thc.ids.inf.framework.opf.rdbms.datastore.ConnectionPoolCreator.create
Co
nne
ctionPool(ConnectionPoolCreator.java:82)
at
com.thc.ids.inf.framework.opf.datastore.DataStoreRepository.createConnecti
on
Poo
lIfNonExistent(DataStoreRepository.java:211)
at
com.thc.ids.inf.util.persistence.content.ConnectionPoolInitializer.createC
on
nec
tionPoolIfNeeded(ConnectionPoolInitializer.java:48)
at
com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.c
re
ate
ConnectionPoolIfNeeded(Unknown Source)
at
com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.g
et
Ima
ge(Unknown Source)
at
com.thc.ids.inf.services.business.crs.ContentRetrievalService.getImage(Unk
no
wn
Source)
at java.lang.reflect.Method.invoke(Native Method)
at
com.thc.ids.inf.util.reflection.MethodDescription.invokeMethod(MethodDescr
ip
tio
n.java:181)
at
com.thc.ids.inf.util.reflection.MethodInvocation.invoke(MethodInvocation.j
av
a:7
9)
at
com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean.invoke(ServiceBean.
ja
va:
186)
at
com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl.invok
e(
Ser
viceBean_bjedmi_EOImpl.java:37)
at
com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl_WLSke
l.
inv
oke(Unknown Source)
atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.ja
va
:93
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
:2
2)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
<Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Checking existence ofconnection
pool Content
ConnectionPool requested by user guest>
<Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Creating connection poolContentConnectionPoo
l requested by user guest>
weblogic.common.ResourceException:weblogic.management.MBeanCreationException:
Start server side stack trace:
javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=JD
BCConnectionPool
at
com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:1
34
at
com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.
ja
va:
2352)
at
com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:
87
4)
at
weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBe
an
Ser
verImpl.java:181)
atweblogic.management.internal.Helper.createMBean(Helper.java:376)
atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at
weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
MB
ean
ServerImpl.java:278)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
635)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
621)
at
weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
nH
ome
Impl.java:397)
atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
:2
2)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.management.MBeanCreationException: - with nested exception:
[javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=J
DBCConnectionPool]
atweblogic.management.internal.Helper.createMBean(Helper.java:383)
atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at
weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
MB
ean
ServerImpl.java:278)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
635)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
621)
at
weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
nH
ome
Impl.java:397)
atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
:2
2)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
- with nested exception:
[javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=J
DBCConnectionPool
Start server side stack trace:
javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=JD
BCConnectionPool
at
com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:1
34
at
com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.
ja
va:
2352)
at
com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:
87
4)
at
weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBe
an
Ser
verImpl.java:181)
atweblogic.management.internal.Helper.createMBean(Helper.java:376)
atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
at
weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
MB
ean
ServerImpl.java:278)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
635)
at
weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
ja
va:
621)
at
weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
nH
ome
Impl.java:397)
atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
Source)
atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
:2
2)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
at
weblogic.jdbc.common.internal.ConnectionPool.dynaStartup(ConnectionPool.ja
va
:47
2)
at
weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.jav
a:
727
at
weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.jav
a:
709
at
com.thc.ids.inf.framework.opf.rdbms.datastore.ConnectionPoolCreator.create
Co
nne
ctionPool(ConnectionPoolCreator.java:82)
at
com.thc.ids.inf.framework.opf.datastore.DataStoreRepository.createConnecti
on
Poo
lIfNonExistent(DataStoreRepository.java:211)
at
com.thc.ids.inf.util.persistence.content.ConnectionPoolInitializer.createC
on
nec
tionPoolIfNeeded(ConnectionPoolInitializer.java:48)
at
com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.c
re
ate
ConnectionPoolIfNeeded(Unknown Source)
at
com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.g
et
Ima
ge(Unknown Source)
at
com.thc.ids.inf.services.business.crs.ContentRetrievalService.getImage(Unk
no
wn
Source)
at java.lang.reflect.Method.invoke(Native Method)
at
com.thc.ids.inf.util.reflection.MethodDescription.invokeMethod(MethodDescr
ip
tio
n.java:181)
at
com.thc.ids.inf.util.reflection.MethodInvocation.invoke(MethodInvocation.j
av
a:7
9)
at
com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean.invoke(ServiceBean.
ja
va:
186)
at
com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl.invok
e(
Ser
viceBean_bjedmi_EOImpl.java:37)
at
com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl_WLSke
l.
inv
oke(Unknown Source)
atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.ja
va
:93
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
:2
2)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) -
How to store Connection object and call it from other programs.
Hi,
I am trying to connect to the database, store the connection object and use this connection object from other standalone java programs.
Can any one tell me how to do this? I've tried in the following way:
In the following program I am connecting to the database and saving the connection object in a variable.
public class GetKT2Connection {
public static void main(String[] args) {
String url = "jdbc:odbc:SQLDsn;
String dbUser = "sa";
String dbPwd = "sa";
Connection kt2conn = Connection connection = java.sql.DriverManager.getConnection(url, dbUser, dbPwd);
if(kt2conn == null) {
System.out.println("Database Connection Failure!");
else {
System.out.println("Connected to Database...");
GetKTConnectionObj.storeKT2ConnectionObj(kt2conn);
} Here is the program to save connection object in a variable.
public class GetKTConnectionObj {
static Connection kt2Connection = null;
public static void storeKT2ConnectionObj(Connection conn) {
kt2Connection = conn;
public static Connection getKT2ConnectionObj() {
try {
return kt2Connection;
catch(Exception e){
System.out.println(e);
return null;
}Now from the following code I am trying to get the connection object that is stored. But this is throwing NullPointerException.
public class Metrics_Migration {
public static void main(String args[]) {
try {
java.sql.Connection connection_1 = GetKTConnectionObj.getKT6ConnectionObj();
catch(Exception e){
}kt2Connection is null. You need to store it first, to make it not null. Otherwise it will stay null forever. And why on earth are you trying to do this THIS way?
If you are running the two applications separately, it wont work either. -
How to show object creation in UML
How to show object creation in UML
In a sequence diagram, it's a line (with arrow) pointing to the new object and the <creates> or <new> tag as mentioned above.
| obj 1 |
|
| <creates> ----------
| --------------> | obj 2 |
| ----------or----------
| obj 1 |
|
| <new> ----------
| --------------> | obj 2 |
| ----------
Maybe you are looking for
-
Why does iTunes tell me the burner is in use?
When trying to burn music discs from iTunes, I'm now getting a message that "the burner is already being used by another application." It's really strange because that's not the case and iTunes burned CDs just fine for years until this past week. I g
-
Hello! I'm a student and I'm currently making a project using pattern matching. My patterns are from chick foot/feet. I'm created multiple pattern matching VI's to detect all the feet because I find it difficult/impossible to match all the feet with
-
Hi Sap Gurus, I am trying to posting with f-40 for L.Cs its asking 001 segment is missing please give me reasonable solution. thanks and regards, Nagaraju.
-
Trouble accessing 2nd e-mail address within same e-mail account.
I successfully added my g-mail account, with my main e-mail address, to my I-phone 5. However, I don't use my main e-mail address anymore and had created a 2nd e-mail address within g-mail where I read my mail. I don't see any way on the I-phone to a
-
To add the multiline data into an internal table from TextEdit
Hello Experts, I have one requirement that I have to use the TextEdit field. and put the values into an internal table. can you help me. with some sample code. Thanks in Advance Kuldeep