Problem with OO4O opendatabase() call, migrating the client from 9i to 10g
I have the following code:
VARIANT* pvaparams = new VARIANT[3];
if (pvaparams == NULL)
return NULL;
for (int nIndex = 0; nIndex < 3; nIndex++)
VariantInit(&pvaparams[nIndex]);
pvaparams[0].vt = VT_I4;
pvaparams[0].lVal = ORADB_ORAMODE;
pvaparams[1].vt = VT_BSTR;
pvaparams[1].bstrVal = bstrConnect; //user and passwd
pvaparams[2].vt = VT_BSTR;
pvaparams[2].bstrVal = bstrDBname; //database name
VARIANT va_out;
VariantInit(&va_out);
va_out.vt = VT_DISPATCH; // expect IDispatch* for database
DISPPARAMS params = {pvaparams, NULL, 3, 0};
EXCEPINFO eInfo;
unsigned int uiArgErr;
//dispid_OpenDatabase OK, previously obtained
hRes = m_pIOracleSession->Invoke( dispid_OpenDatabase, IID_NULL,1033,
DISPATCH_PROPERTYGET , ¶ms , &va_out,
&eInfo, &uiArgErr );
if ( FAILED( hRes ) )
throw new COracleDBXception(eInfo);
This is from an application developped in VC++ 5 which uses COM and OO40 for connecting to a 9i database; and works fine, with a 9.2.0.1.0 client.
I have updated the server to 10g and kept the client and it's running OK.
After that, I have installed the 10.2.0.1.0 client and it's not working anymore; the odd thing is that the call to Invoke() has succeded and hRes is 0, but there is no connection to the database!!!
I set a breakpoint after Invoke() and, from PL/SQL Developer, the "select OSUSER, PROGRAM, TERMINAL from v$session t where username='NORO';" command reports nothing; with the 9i client, it was reporting 1 connection.
I would like to add that I had uninstalled completely the 9i client and after that I installed the 10g client.
Can anyone give me a hint?
Thank you!
Hi everyone!
static const CLSID CLSID_Oracle =
{0x3893b4a0, 0xffd8, 0x101a, {0xad, 0xf2, 0x04, 0x02, 0x1c, 0x00, 0x70, 0x02}};
const DWORD ORADB_ORAMODE = 0x1 ;
STDMETHODIMP Test()
HRESULT hr;
IDispatch* pIDefaultSession;
hr = ::CoCreateInstance( CLSID_Oracle, NULL, CLSCTX_SERVER, IID_IDispatch, (void**)&pIDefaultSession );
if (hr != S_OK)
return S_FALSE;
// CreateNamedSession - DISPID: 0x6001000B
// OpenDatabase - DISPID: 0x60010001
// create unique name
TCHAR strName[256];
stprintf( strName, T("Session#%d"), 1);
// call 'CreateNamedSession' method
VARIANT vaparam;
VariantInit(&vaparam);
vaparam.vt = VT_BSTR;
vaparam.bstrVal = SysAllocTString(strName);
VARIANT va_out_3nd;
VariantInit(&va_out_3nd);
va_out_3nd.vt = VT_DISPATCH; // expect IDispatch* for named session
DISPPARAMS params = {&vaparam, NULL, 1, 0};
EXCEPINFO excepinfo;
unsigned int uiArgErr;
// Invoke CreateNamedSession
hr = pIDefaultSession->Invoke( 0x6001000B, IID_NULL, 1033, DISPATCH_PROPERTYGET, ¶ms, &va_out_3nd, &excepinfo, &uiArgErr );
::SysFreeString(vaparam.bstrVal);
if ( FAILED(hr) )
return S_FALSE;
CComPtr<IDispatch> m_pIOracleSession; // pointer to the session
m_pIOracleSession.p = va_out_3nd.pdispVal;
// call "OpenDatabase" method
HRESULT hRes;
CSString m_strDbId = _T("databasename");
CSString m_strUserName = _T("username");
CSString m_strPswd = _T("password");
CComBSTR bstrDBName = SysAllocTString(m_strDbId);
CComBSTR bstrConnect = SysAllocTString(m_strUserName + T("/") + mstrPswd);
VARIANT* pvaparams = new VARIANT[3];
if (pvaparams == NULL)
return S_FALSE;
for (int nIndex = 0; nIndex < 3; nIndex++)
VariantInit(&pvaparams[nIndex]);
pvaparams[0].vt = VT_I4;
pvaparams[0].lVal = ORADB_ORAMODE;
pvaparams[1].vt = VT_BSTR;
pvaparams[1].bstrVal = bstrConnect;
pvaparams[2].vt = VT_BSTR;
pvaparams[2].bstrVal = bstrDBName;
VARIANT va_out_2nd;
VariantInit(&va_out_2nd);
va_out_2nd.vt = VT_DISPATCH; // expect IDispatch* for database
DISPPARAMS params_2nd = {pvaparams, NULL, 3, 0};
EXCEPINFO eInfo;
unsigned int uiArgErr_2nd;
// invoke OpenDatabase:
//here is the problem!!!
hRes = m_pIOracleSession->Invoke(0x60010001, IID_NULL, 1033, DISPATCH_PROPERTYGET , ¶ms_2nd , &va_out_2nd, &eInfo, &uiArgErr_2nd );
delete pvaparams;
if ( FAILED( hRes ) )
return S_FALSE;
CComPtr<IDispatch> m_pDatabase;
m_pDatabase.p = va_out_2nd.pdispVal;
CreateCustomDynaset - DISPID: 0x6001000C
ExecuteSQL - DISPID: 0x60010006
LastServerErrText - DISPID: 0x60010009
Parameters - DISPID: 0x00000000
LastServerErrReset - DISPID: 0x6001000B
TCHAR* pAlterNumeric = T("ALTER SESSION SET NLSNUMERIC_CHARACTERS = \".,\"");
// call "ExecuteSQL" method
VARIANT va_params;
VariantInit(&va_params);
va_params.vt = VT_BSTR;
va_params.bstrVal = SysAllocTString(pAlterNumeric);
DISPPARAMS params_3nd = {&va_params, NULL, 1, 0};
unsigned int uiArgErr_3nd;
// Invoke ExecuteSQL:
hr = m_pDatabase->Invoke( 0x60010006, IID_NULL, 1033, DISPATCH_METHOD, ¶ms_3nd, NULL, &eInfo, &uiArgErr_3nd );
if (FAILED(hr))
return S_FALSE;
return S_OK;
If this function is called from DllMain(), it works. But if we call this function from another method from our .dll, and that method is called via COM from a client, this function doesn't work anymore! We use VC++ 5 and the 10g Oracle client.
Can anyone give me a explanation?
PS: The call to opendatabase() is successfull, but we don't see a connection on the database server and we get a SEGV error: "function not mapped to object".
Noro
Similar Messages
-
Problem with multiple Ajax calls to the same Servlet
Hi,
I am new to AJAX. I have a requirement where in, i have to make ajax calls to the same servlet in an infinite loop and check for an application context attribute to refresh the contents in the JSP.I am using the following script in JSP. The problem is i am not able to invoke the servlet more than one time.But I am able to go through the script at specific time interval using setInterval() function of Javascript and able to get alerts.But the problem is with xmlhttp.open("Get", url, true);. Its not getting called more than one time, even though i make multiple calls to the function.
*<script type="text/javascript">*
var xmlhttp
var resp
function fAjax()
alert("Here");
xmlhttp=null;
resp=null;
// code for Mozilla, etc.
if (window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();
// code for IE
else if (window.ActiveXObject)
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
if (xmlhttp!=null)
xmlhttp.onreadystatechange=state_Change;
xmlhttp.open("GET","/PSAPBackOffice/TestServlet",true);
xmlhttp.send(null);
else
alert("Your browser does not support XMLHTTP.")
function state_Change()
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
// if "OK"
if (xmlhttp.status==200)
resp=xmlhttp.responseText;
//alert(resp);
if (resp=="CALL"){
form.method="GET";
form.action="/Project/Details.jsp
form.submit();
else
alert("Problem retrieving XML data")
function callTimer(){
setInterval("fAjax()",5000);
*</script>*
*Code for Servlet here:*
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException
ServletContext objContext= getServletContext();
String value;
synchronized (objContext) {
value=(String) objContext.getAttribute("Flag");
if(value==null){
else if(value.equals("Done")){
response.setContentType(CONTENT_TYPE);
PrintWriter out = null;
try {
out = response.getWriter();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NullPointerException npe) {
// TODO Auto-generated catch block
npe.printStackTrace();
objContext.setAttribute("Flag","No");
out.println("CALL");
Can someone figureout the problem or mistake and help me out.Its urgent and please help me in this regard.Thanks in Advance !I'm not sure I'm following you. The mapping from URL to servlet can contain anything you want. So you could have the URL /blah/blah/blah that, with a mapping something like /blah/* would pass all requests with that URL pattern to your servlet - no one has to know it is a servlet. Your servlet could then parse the URL to see what it has to do or you could pass parameters as part of the URL or as hidden fields.
-
Problem with mutiple BAPI calls during the commit
Hi all,
I am trying to create accounts for a given partner i the transaction F9K1 using the BAPI BAPI_BKK_ACCNT_CREATE. After calling the BAPI I am committing it too.
The problem is if I try to create multiple accounts like RCA, ACA, MCA, IOE and so on, the first time the BAPI is called to create RCA account it is successful an it is even committing. When I call the BAPI to create the the ACA account the return table from the BAPI shows success message but the commit fails. If I restart the program and try creation of accounts now the RCA will throw a error msg saying account already exist, ACA account will be created and then the MCA account creation fails in the same manner explained above.
I see the issue is with multiple BAPI calls and I tried using all sort of methods like clearing buffers, start new task in local and wait command and all. But none of them seems to be working for me.
Can anyone please guide me on how I can overcome this problem.
Thanks.BAPI :
BAPI BAPI_BKK_ACCNT_CREATE
Functionality
Use this method to create an account in Bank Customer Accounts. This method returns the following values:
Identification details for the newly created account such as the internal and the external account number, and the bank area details
A table containing error messages
To create an account by using this method, you must specify values for the import parameters Bank Area (BANKAREA) and Product (PRODUCTNAME).
Note: You must also specify a value in the External Account Number (EXTERNALACCOUNTNR) parameter if you have defined an external number range for the bank .
REgards,
Jayan. -
I cannot configure the clients with POP account after migrating the Exchange from 2007 to 2013
Hi,
When i configure the POP account on Outlook 2010 is giving the error message
"Send test e-mail message: Cannot send the message. Verify the e-mail address in your account properties. The server responded: 550 5.7.1 Client does not have permissions to submit to this server"
please help me out on this,
Thanks in advance
Regards,
Murugan.SThe OP says users can't send mail. POP is not used to send mail.
I strongly recommend you have users reconfigure their clients to send using port 587. This has been the default configuration since the introduction of Exchange 2007. You can modify the default receive connector, or add another receive connector
to allow clients to connect and authenticate if you want, but when you do so, you will risk causing message mail flow to fail.
I am not going to try to tell you how to do it precisely because I don't want to be a party to you messing up your mail flow. Here's more documentation on receive connectors from TechNet.
http://technet.microsoft.com/en-us/library/aa996395(v=exchg.150).aspx
Ed Crowley MVP "There are seldom good technological solutions to behavioral problems." -
Problem with java.util while migrating an app. from Apache to OC4J
Hello.
I have a application which runs fine under APache/Jserv . This
application contains bunch of jsp's. In the jsp's even though
there are no directives for import of java.util.* packages it
still works fine. But under oc4j the same application does not
work unless I modify the jsp to include java.util.* in the
import directive. What am I missing here?.
Thanks in advance.
PrakashHi,
I think that Apache/Jserv does the inlcude of java.util.*
automatically which OC4J dosen't.
Thanks,
Andy
Hello.
I have a application which runs fine under APache/Jserv . This
application contains bunch of jsp's. In the jsp's even though
there are no directives for import of java.util.* packages it
still works fine. But under oc4j the same application does not
work unless I modify the jsp to include java.util.* in the
import directive. What am I missing here?.
Thanks in advance.
Prakash -
Can any one please help me I am having problem with me Iphone4, looks like the mic of my phone is not working. no one can hear me if I make a call to them. I have tried all restoring options but no use. please help me
The mic on my iPhone4 has just quit also. Similar symptoms to yours in that people I'm talking to hear only static or my voice very faintly. The voice/memo recorder also only really records static.
It happened suddenly and seemed to get better after a day or two but then went completely after another day.
I'm returning it to Vodafone New Zealand shortly but will have to wait 5-10 days for a replacement. There are NO Apple accredited means to speed this procedure up in NZ.
We don't even have a single physical Apple Store where you could walk in and talk to a Genius. -
I have iphone 4 and the software is ios 7.0.2. I am facing problems with my phone. Since the last software update my phone has started giving problems. like it hangs sometime when i recieve an incoming call. The carrier status bar shifts down a bit and sometimes it vanishes automatically. I,m confused.
Secondly i have an update IOS 7.0.4 waiting in my Software Update menu. I have tried so many times to update my iphone but it always fails to update the IOS 7.0.4. Any body suggest anything regarding thisWow. Lots of help. Thanks apple
-
I just had problems with a game called call of duty 4, modern warfare. I decided that if I deleted it, I could reinstall it, I could get it back to normal. After I deleted it,I went to to the appstore and went to purchases and accidentaly deleted it. please help me!
You have not deleted it from the purchases list, it is just hidden. To unhide an app, open the Mac App Store app, click the Account link in the Quick Links to the right of the pane and go to the iTunes in the Cloud section where you can manage hidden apps.
-
After using migration assistant I have had problems with some apps that were brought down from App store, as well as IntelliJ that just doesnt want to start at all. Does it have anything to do with the UID being changed?
13-07-03 6:24:12.447 PM com.apple.launchd.peruser.502[1632]: ([0x0-0x5be5be].com.jetbrains.intellij[5805]) Job failed to exec(3) for weird reason: 13What is the exact name of the application you're trying to launch? Is it in the Applications folder?
-
Having problem with siri on calling someone
Hi.. i'm having a problem with siri when calling someone..it says " i can't call using that number "
Im from Mauritius, our mobile number having been migrated into 8-digits since 1 month. I'd turn off siri, reset setting.. its the same!
whats wrong with that?i"m from Mauritius also having the same problem when calling someone using siri.
i think its because, of the 8 digits number. -
Problem with messages and calls,, please respond
Problem with my iphone is that the messages are sent and received very late, it hangs while sending, when delete a message it takes time to open messages firstly... messages in the thread disappear and such abnormalities.
and in Calls, i receive notification when the call is missed.
help!I would do a full restore using iTunes (backup first, of course)
-
Problem with messages and calls
Problem with my iphone is that the messages are sent and received very late, it hangs while sending, when delete a message it takes time to open messages firstly... messages in the thread disappear and such abnormalities.
and in Calls, i receive notification when the call is missed.
help!Ritu Parchure wrote:
I have ulmocked and restored the iphone.
I assume you mean "unlocked and restored." My apologies if I msunderstand, but if you unlocked it yourself, then you must have hacked it. If it was originally locked at the time of purchase, only that carrier can unlock it. -
Hiya, I've got a weird problem with my iPhone4. On the 'home page' of my iPhone the mail symbol tells me there's a new mail waiting for me. However, there's no new mail to be found. Does anyone know what the problem is? Thanks
This response is a little late as I just read about your problem. I have a 2012 Dodge Charger and a 2012 Chrysler Town and Country and both worked flawlessly with the iPhone 5s my wife and I had. However, we just upgraded to the iPhone 6 and Uconnect will receive calls but you cannot answer them. You can callout successfully, however. the annoyance being the inability to answer incoming calls in the HandsFree mode.
-
Problem with program hanging randomly on certain commands from win 7 pro client to SB Server
Having a problem with program hanging randomly on certain commands from Win-7 Pro Client to SB Server Both 64-Bit
Five other slower XP-Pro 32 Bit systems though they are older and slower systems do not seem to hang as readily if at all.
It has been very frustrating as the Client-System, SB-Server and Program should work w/o any hitches, but this seems to work fine @ times and then hang randomly.
Would appreciate any and all suggestions in assisting.... JimBAgde-MSSYou can try this, as I have had similar problems with another MS Access .MDB file and slow access before. This fixed my problem for me. On the slow computer, make sure the program is set to see the .mdb file via UNC path, not a mapped drive letter. ex.
USE: \\yourserver\shared\dental\file.mdb
DO NOT: S:\\shared\dental\file.mdb
hope this helps -
Problems with Java AQ interface migrating 9i to 10g
Hi!
I've got problems with Java AQ Interface migrating from 9i DB, JDBC, AQ to 10g rel.2 DB, JDBC, AQ
First, i started to occasionally receive NullPointerException in Oracle JDBC 9.2.0.8
java.lang.NullPointerException
at oracle.jdbc.driver.OracleStatement.describe(OracleStatement.java:6439)
at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:6203)
at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1557)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1543)
at gpnic.messaging.LDAPMessenger.messageFromRS(Unknown Source)
We were using 9.2.0.8 JDBC and 9i and 10g databases.
We decided to go up for 10g r2 JDBC Drivers, and 10.2 AQ but started to get the following errors:
oracle.AQ.AQOracleSQLException: ORA-25216: invalid recipient, either NAME or ADDRESS must be specified
ORA-06512: на "SYS.DBMS_AQIN", line 454
ORA-06512: на line 1
at oracle.AQ.AQOracleQueue.enqueue(AQOracleQueue.java:1267)
at gpnic.comm.messaging.transport.AQTransportAdapter$AQDestanation.send(AQTransportAdapter.java:607)
at gpnic.comm.messaging.transport.OutboundThread.run(OutboundThread.java:83)
I'm specifying address of an agent, but oracle says I am not.
I tried both native AQ and JMS interfaces, bot got the same error. I specify recipient the following way:
'consumer' var contains name of AQ agent and is not null
native AQ interface:
aqSess = AQDriverManager.createAQSession(db_conn);
AQQueue destQ = aqSess.getQueue(schema, queue);
dequeueOptionsOut = new AQDequeueOption();
dequeueOptionsOut.setWaitTime(AQDequeueOption.WAIT_NONE);
dequeueOptionsOut.setConsumerName(consumer);
dequeueOptionsOut.setDequeueMode(AQDequeueOption.DEQUEUE_REMOVE);
dequeueOptionsOut.setNavigationMode(AQDequeueOption.NAVIGATION_FIRST_MESSAGE);
AQMessageProperty mpOut = new AQMessageProperty();
Vector vRecpt = new Vector();
vRecpt.add(new AQAgent(consumer, null, 0));
mpOut.setRecipientList(vRecpt);
AQMessage aqMsg = null;
AQEnqueueOption eOpt = null;
//prepare message
aqMsg = destQ.createMessage();
CLOB chMsg = CLOB.createTemporary(db_conn, true, CLOB.DURATION_SESSION);
chMsg.open(CLOB.MODE_READWRITE);
chMsg.putString(1,msg);
//creating oracle type message
gpnic.db.SDSTypes.SdsMsgT oraMsg = new gpnic.db.SDSTypes.SdsMsgT(chMsg);
AQObjectPayload payload = aqMsg.getObjectPayload();
payload.setPayloadData(oraMsg);
//setting properties
aqMsg.setMessageProperty(mpOut);
//do enqueueOut
eOpt = new AQEnqueueOption();
destQ.enqueue(eOpt, aqMsg); //<- here AQOracleSQLException is thrown
JMS interface to Oracle AQ:
TopicSession session;
TopicConnection connection;
TopicPublisher publisher;
AQjmsAgent[] recipientList;
connection = AQjmsTopicConnectionFactory.createTopicConnection(db_conn);
session = connection.createTopicSession(true, Session.CLIENT_ACKNOWLEDGE);
connection.start();
Topic topic = ((AQjmsSession) session).getTopic(schema, queue);
publisher = session.createPublisher(topic);
recipientList = new AQjmsAgent[1];
recipientList[0] = new AQjmsAgent(consumer, null);
CLOB chMsg = CLOB.createTemporary(db_conn, true, CLOB.DURATION_SESSION);
chMsg.open(CLOB.MODE_READWRITE);
chMsg.putString(1,msg);
//creating oracle type message
gpnic.db.SDSTypes.SdsMsgT oraMsg = new gpnic.db.SDSTypes.SdsMsgT(chMsg);
AdtMessage adtMessage = ((AQjmsSession)session).createAdtMessage();
adtMessage.setAdtPayload(oraMsg);
((AQjmsTopicPublisher) publisher).publish(adtMessage, recipientList); <- here Exception is thrown
We tried the following combinations
9i DB, 9i jdbc, 9i aq - enqueue ok
10g DB, 9i jdbc, 9i aq - enqueue ok
10g DB, 10g jdbc, 10g aq - exception is thrown
Can anyone help?Duplicate post, please check Upgrade 9i to 10g
Maybe you are looking for
-
How to do Home Share with 2 different Apple ID's? Spouse and I
How do I set up the Home Share when there are 2 different Apple ID's? Spouse and I. We each have accounts but are trying to share music. Is this possible? Can I reset my Apple ID and Password?
-
I recently moved from CF5 to MX 7. When going through a CFMAIL query if an email address in to "To" field is malformed, the entire application appears to stop. In previous versions, it would continue sending email but would simply throw the malformed
-
I get the following error message when I connect a usb ethernet adapter to my new MacBook Pro: Unsupported - You cannot use an Apple USB Modem with this computer. I live where we only have dial-up and the Apple Store said this is what I need. In addi
-
How do I get wifi back on my ipod
how do I get wifi back on my ipod, I already updated and retore and still the wifi and bluetooth is still grey.
-
Hi, Is it possible to set dynamic members (not dynamic time series) in smartview for Essbase datasource,if so how to create it. Thanks in advance.