Trouble accessing a database in a deployed application

I am having difficulty accessing a database on a deployed application.  I am using LV2009, and Windows XP.    I am interfacing with the database via ODBC.  The database is located in the "Shared Documents" folder.  I have no problem accessing the database when logged in as the administrator, but when i use the production login I cannot get to it (I can see it in explorer).  I have given the production login administrative privileges and still cannot access it.  I can save a notepad file to that folder when using the production login.  What do I not have set properly in the database setup?
Thanks in advance.
Jim
Jim
LV 2013

Sorry I got the error code mixed up!
// MessageId: DB_E_CANCELED
// MessageText:
//  Operation was canceled.
#define DB_E_CANCELED                    ((HRESULT)0x80040E4EL)
This would indicate that there was some operation like a login dialog or similar that was canceled. It could be that you have assigned a username and passowrd in Access to the database file. In that case you do need to specify the correct username and password in the DSN connection settings otherwise the ADO/ODBC driver wants to prompt you with a dialog for this information, but this has to be enabled with the "prompt? (f)" input to the DB Open Connection method. If that parameter is false, all the ADO library can do is to abort the connection.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Trouble accessing the database

    Hi, am new to java and I am having trouble accessing my database. I have the following code
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    private static boolean verifyInDB(String username, String password){
    boolean allow = false;
    try {
    Driver d =(Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    conn = DriverManager.getConnection("jdbc:odbc:SITSDB");
    queryStr = "SELECT username,\"password\" FROM WebAppUsers WHERE username=" + "'" + username + "'" + "AND password=" + "'"+ password + "'" + "AND archive = 'no'";
    myQuery = conn.prepareCall(queryStr);
    //myQuery.setString(1, username);
    //myQuery.setString(2, password);
    rs = myQuery.executeQuery();
    if(rs.next())
    allow = true;
    catch (Exception e) {
    System.out.println("Login::verifyInDB: Error Getting Connection: " + e.toString());
    System.out.println("Login::verifyInDB: QUERY: " + queryStr);
    e.printStackTrace();
    finally{closeConn();}
    return allow;
    I'm almost positive the code it is right however I get an error trying to connect to the database
    Login::verifyInDB: Error Getting Connection: java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'WebAppUsers'.
    Login::verifyInDB: QUERY: SELECT username,"password" FROM WebAppUsers WHERE username='akabeera'AND password='avenash'AND archive = 'no'
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'WebAppUsers'.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3150)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute( JdbcOdbcPreparedStatement.java:214)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery( JdbcOdbcPreparedStatement.java:89)
    at com.siac.ManagementReports.Login.verifyInDB(Login.java:43)
    at com.siac.ManagementReports.Login.verify(Login.java:27)
    at org.apache.jsp.doLogin_jsp._jspService(doLogin_jsp.java:60)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    any suggestions is much appreciated
    Message was edited by:
    ssj_100

    To be clear when you say the command works in query analyzer. Is this the exact string that you are running in query analyzer?
    SELECT username,"password" FROM WebAppUsers WHERE username='akabeera'AND password='avenash'AND archive = 'no'This exact string (the SELECT) looks syntactically incorrect to me, but that doesn't mean your database SQL parser cannot handle it I guess (lack of spaces between quotes keywords), and I'm not sure about the double quotes, but I'm kind of an Oracle guy and all of this could be OK, it just seems messy if nothing else.
    I would recommend using first, a type 4 driver if at all possible (not the JDBC/ODBC bridge), and second To avoid much of this messiness, you should whenever possible use a PreparedStatement rather then Statement for this type (and most types) of queries.

  • How to access MDB database from JSP Web Application?

    hi
    i am using tomact and developing appplication in which i have to insert data into MDB database and read/Update/Delete Data in MDB DataBase.
    could any help in this issue?
    Thanks
    Regards
    Oersla Afroze Ahmed

    Hi,
    For accessing MDB database, you must have a jdbc:odbc driver, u can get it from sun site.
    just put it into the lib folder of web server.
    or
    just follow the following link:
    http://www.developer.com/db/article.php/3571661
    keshri

  • Permissions of SQL Server Database changes when deploying application

    Hi.
    When deploying my application, I find that the permission changes as in the screenshot below and hence I cannot update the database. It becomes read only.
    However, before deployment, I had already set the permissions for Users to Full Control.
    The Read-Only properties is set to False in the Setup for deployment. Help please.

    If deploying a file for read/write permissions on the O/S(s) talked about in the link, then you need to deploy the file to ProgramData (all users folder) or to a folder you created with the persmission needed at the folder level. You deploy  the file
    to Program Files folder, then the O/S(s) are only going to allow read and read/execute.
    https://technet.microsoft.com/en-us/library/ff716245.aspx?f=255&MSPPError=-2147217396

  • Connecting to Access 97 Database sporatically freezes my application, why?

    I have a program written in LabView 5.1 that interfaces with a DB to gather test data. This program was functioning fine for about 2 years and then all of a sudden started to have problems. There were no updates to the DB that I know of. The DB resides on a networked drive, the same one that it resided on for the 2 years it worked. Now I can sometimes (very rarely) get the test data from the DB without freezing. I have traced the program through and found that it is freezing on the SQLCIN.vi. This .vi is used in almost ever SQL function but it fails when the Connect.vi is using it. I have noticed that inside one of the Where Loops the DSN will not get passed to the Connect.vi about 3 times
    and then it finally get's passed and finds the data. The connect will not fail when there is no DSN specified but if it is going to fail it will only do so if the DSN was succesfully passed in. Even with the DB residing locally this problem persists. I have also downloaded and example that someone posted to this site of how tO access a .MDB file and performing several Reads with this sample program that freezes as well. I suspect that it may be drivers that are the problem, I am running on an NT4.0 SP5 machine, MDAC v1.5

    I haven't used the SQL Toolkit in a couple of years. I converted to LabSQL when I had similar problems. There's a couple of things you might try. First, if you don't do it on a regular basis, try compacting the Access Database or try some queries on a new database with only a small number of records. Second, try reinstalling Access. I had a couple instances where the local installation had gotten corrupted somehow. I also remember a problem with one of the NT service packs. You could try installing SP6 to see if that makes a difference. Lastly, MDAC 1.5 is pretty old. The latest version is 2.8 ubt I would try the other things first.

  • PERFORMANCE while accessing remote database DB2 on AS/400 using WAS

    Subject: PERFORMANCE while accessing remote database
    We have IBMWebSphere Application Server Standard Edition 3.5.3 running on
    AS/400 iSeries Server (V4R5, test)and local DB2 Database.
    I am using AS/400 Developer Kit for Java JDBC Driver(type2, com.ibm.db2.jdbc.app.DB2Driver)
    to talk to local database. The performance was very good.
    When I try to access remote database (every thing same as local) which is on another AS/400
    machine of V4R4 (we use it for production, remote database) using IBM Toolbox for Java JDBC driver
    (com.ibm.as400.access.AS400JDBCDriver, type 4 driver), I can see 30to40%decrease in performance.
    Here we have WAS on previous V4R5 AS/400 machine.
    My questions are
    Is the performance decrease is due to
    1. the driver I am using? if it is Is there any other alternative drivers to access
    remote database to boost performance?
    2. the release difference of local(V4R5) and remote data base(V4R5)
    3. Currently most uses remote database while we do this testing. Is that the cause?
    or Is there any other cause or Drivers etc??? Suggestions and help is most welcome.
    Thank you.

    What about
    4. the data has to travel across the network.

  • Database access from Oracle Java Cloud Service application

    I have registered for Oracle Java Cloud Service for trial period. I want to deploy a Spring MVC 3.2 and Hibernate 4.0 web application.
    I created a table in the Database Cloud. I am not sure how do I access the Database Cloud Service from my application.
    Need your guidance/pointers/references that can help me establish connection from my application to the database.
    Thanks,
    Ujjwal

    Hi,
    Use JPA - see the visitors example, it uses @PersistenceUnit injection with previously weaved .class entity files.
    You can use application managed EMF's and EntityManagers with code like the following - which is not preferable to using @PersistenceContext injection on an @Stateless session EJB but...
              EntityManagerFactory emf = Persistence.createEntityManagerFactory("JPAServletPU");
              EntityManager em = emf.createEntityManager();
              EntityTransaction transaction = null;
              try {
                   transaction = em.getTransaction();
                   transaction.begin();
                   Visitor entity = new Visitor();
                   entity.setName(name);
                   entity.setNum(num);
                   em.persist(entity);
                   transaction.commit();
                   System.out.println("Committing: " + entity);
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   em.close();
                   emf.close();
    Use a persistence.xml like the following
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="JPAServletPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
         <!--https://cloud.oracle.com/mycloud/f?p=5300:1000:259334829915901-->
    <jta-data-source>database</jta-data-source>
    <class>com.vision.cloud.jpa.Visitor</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
         <property name="eclipselink.target-database" value="Oracle10g" />
    <property name="eclipselink.ddl-generation" value="create-tables"/>
    <!-- property name="eclipselink.ddl-generation" value="drop-and-create-tables"/-->
    </properties>
    </persistence-unit>
    </persistence>
    Check out a tutorial on WebLogic JPA ORM usage here to get started as well.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • Access Denied error while opening the deployed Application

    Hi,
    When I try to open my deployed application I get the following error:
    weblogic.net.http.SOAPHttpsURLConnection
    Im using the following code in my application:
    URL wsURL = new URL(wsLocation + "?command=login");
    So I went ahead and changed my code to this:
    java.net.URL wsURL = new URL(null, wsLocation + "?command=login",new sun.net.www.protocol.https.Handler());
    But I got the following error:
    access denied (java.lang.RuntimePermission accessClassInPackage.sun.net.www.protocol.https)
    Also I believe sun.* packages are not supported anymore on cloud. I think it might be because of this it failed the second time.
    Is there any workaround for this?
    Regards,
    Abhishek

    Access denied indicates the user account uploading the file doesn't have access to the library, or sometimes it means there's already a document in the library with the same name that was never checked in. It's also possible that your template contains
    custom code that tries to do something that is not allowed.
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • Client-Side Java Application accessing a database

    Hello Sun Forums,
    I'm developing a Java based client application which accesses a MySQL database server via JDBC.
    My question is: How can I store the password for accessing the database in a secure way on the client? I'm looking for something like the Oracle wallet. I don't know if there is a solution to this problem. Any user could do reverse engineering and extract the password out of the source code. One way hash algorithms don't work either. Any help concerning this topic is highly appreciated.
    Thanks, Yves

    YvesW wrote:
    Hello Sun Forums,
    I'm developing a Java based client application which accesses a MySQL database server via JDBC.
    My question is: How can I store the password for accessing the database in a secure way on the client? I'm looking for something like the Oracle wallet. I don't know if there is a solution to this problem. Any user could do reverse engineering and extract the password out of the source code. One way hash algorithms don't work either. Any help concerning this topic is highly appreciated.From your subsequent descriptions any 3rd party product will still not be a satisfactory solution. What you can do is to not make the DB visible by the end user and query only through request to a webserver. If you wish to adhoc type of queries, you can have a sql validation request, if your sql server supports that.
    If you cannot use a webserver interface, then throw the idea out about saving the client password, the user is just going to have to enter their password. If you are worried about entering the password and cannot use a webserver, then you don't have a project.
    Have the client call on the phone and request an extract, then send it to them on a DVD. But that can be intercepted in the mail. Even if it's encrypted, they have your data and eventually they will decrypt it.
    BTW: security is only an illusion that lets us sleep at nights, in reality, it is nothing more than a hinderance: if someone really wants to access your web connected resource, then they are going to eventually find a way to do it.

  • How to access the database tables from application

    Hii all,
    The information in webcenter content, such as meta data fields, users, security groups etc are stored in
    database tables like-      Revisions, SecurityGroups, Users, DocType etc..
    Can we access this tables from an adf application or any webcenter application..
    If yes, then what can be the approach for that..??
    Another things, how can we create custom tables just like the predefined tables...??
    Any information regarding this.??
    Thanks

    Can we access this tables from an adf application or any webcenter application.Yes, you can - like to any other existing database. But I would strongly discourage you from any, but read-only access, or you can easily end up with inconsistent data.
    If yes, then what can be the approach for that..??Just create a database connection and define in your model what tables you want to access.
    Another things, how can we create custom tables just like the predefined tables...
    Actually, WebCenter Content provides functionality of creation of custom tables (see http://docs.oracle.com/cd/E23943_01/doc.1111/e10978/c04_metadata.htm#autoId2 ) and these are probably the only good candidates for read-write access. See further in the manual what use cases are supported. Of course, you could do this even externally, but rather than Data Definition Language, I'd use services (if there are some).

  • Application hangs during accessing transactional database.

    Hi! Here is minimazed test which creates a database with secondary index, fills it with some records and then starts two threads. One thread adds records, another thread deletes records. The problem is that threads hangs with the following backtraces:
    (dbx) thread t@2
    Current function is __db_pthread_mutex_lock
    204 RET_SET((pthread_cond_wait(
    t@2 (l@2) stopped in ___lwp_cond_wait at 0xfffffd7ffee6e8ea
    0xfffffd7ffee6e8ea: ___lwp_cond_wait+0x000a: jae ___lwp_cond_wait+0x18 [ 0xfffffd7ffee6e8f8, .+0xe ]
    (dbx) where
    current thread: t@2
    [1] ___lwp_cond_wait(0xfffffd7ffeb88620, 0xfffffd7ffeb88608, 0x0, 0x0, 0xfffffd7ffeb88608, 0xfffffd7ffeb9dfb8), at 0xfffffd7ffee6e8ea
    [2] __lwp_cond_wait(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ffee574ec
    =>[3] __db_pthread_mutex_lock(dbenv = 0x41c7f0, mutex = 118U), line 204 in "mut_pthread.c"
    [4] __lock_get_internal(lt = 0x420f90, locker = 2147484656U, flags = 0, obj = 0x424eb0, lock_mode = DB_LOCK_WRITE, timeout = 0, lock = 0xfffffd7ffe9fd760), line 808 in "lock.c"
    [5] __lock_vec(dbenv = 0x41c7f0, locker = 2147484656U, flags = 0, list = 0xfffffd7ffe9fd748, nlist = 2, elistp = 0xfffffd7ffe9fd740), line 116 in "lock.c"
    [6] __db_lget(dbc = 0x424df0, action = 2, pgno = 5U, mode = DB_LOCK_WRITE, lkflags = 0, lockp = 0xfffffd7ffe9fd8d8), line 1006 in "db_meta.c"
    [7] __bam_search(dbc = 0x424df0, root_pgno = 1U, key = 0xfffffd7ffe9fdc68, flags = 1410U, slevel = 1, recnop = (nil), exactp = 0xfffffd7ffe9fda6c), line 489 in "bt_search.c"
    [8] __bam_c_search(dbc = 0x424df0, root_pgno = 0, key = 0xfffffd7ffe9fdc68, flags = 25U, exactp = 0xfffffd7ffe9fda6c), line 2479 in "bt_cursor.c"
    [9] __bam_c_get(dbc = 0x424df0, key = 0xfffffd7ffe9fdc68, data = 0xfffffd7ffe9fdce0, flags = 25U, pgnop = 0xfffffd7ffe9fdb34), line 953 in "bt_cursor.c"
    [10] __db_c_get(dbc_arg = 0x42f6f0, key = 0xfffffd7ffe9fdc68, data = 0xfffffd7ffe9fdce0, flags = 25U), line 689 in "db_cam.c"
    [11] __db_c_put(dbc_arg = 0x424460, key = 0xfffffd7ffe9fdf28, data = 0xfffffd7ffe9fdf00, flags = 20U), line 1327 in "db_cam.c"
    [12] __db_put(dbp = 0x41d070, txn = 0x423f30, key = 0xfffffd7ffe9fdf28, data = 0xfffffd7ffe9fdf00, flags = 20U), line 380 in "db_am.c"
    [13] __db_put_pp(dbp = 0x41d070, txn = 0x423f30, key = 0xfffffd7ffe9fdf28, data = 0xfffffd7ffe9fdf00, flags = 20U), line 1500 in "db_iface.c"
    [14] Db::put(this = 0x41c708, txnid = (nil), key = 0xfffffd7ffe9fdf28, value = 0xfffffd7ffe9fdf00, flags = 20U), line 340 in "cxx_db.cpp"
    [15] Storage::put(this = 0x41c690, key = 2003, data = 2003), line 114 in "bdb_put_del_hang.cpp"
    [16] reading_thread_func(arg = (nil)), line 161 in "bdb_put_del_hang.cpp"
    [17] thrsetup(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ffee6b40b
    [18] lwpstart(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ffee6b640
    (dbx) thread t@3
    Current function is __db_pthread_mutex_lock
    204 RET_SET((pthread_cond_wait(
    t@3 (l@3) stopped in ___lwp_cond_wait at 0xfffffd7ffee6e8ea
    0xfffffd7ffee6e8ea: ___lwp_cond_wait+0x000a: jae ___lwp_cond_wait+0x18 [ 0xfffffd7ffee6e8f8, .+0xe ]
    (dbx) where
    current thread: t@3
    [1] ___lwp_cond_wait(0xfffffd7ffeb88668, 0xfffffd7ffeb88650, 0x0, 0x0, 0xfffffd7ffeb88650, 0xfffffd7ffeb9dfb8), at 0xfffffd7ffee6e8ea
    [2] __lwp_cond_wait(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ffee574ec
    =>[3] __db_pthread_mutex_lock(dbenv = 0x41c7f0, mutex = 119U), line 204 in "mut_pthread.c"
    [4] __lock_get_internal(lt = 0x420f90, locker = 2147484655U, flags = 0, obj = 0x424b80, lock_mode = DB_LOCK_WRITE, timeout = 0, lock = 0xfffffd7ffe7fd7d0), line 808 in "lock.c"
    [5] __lock_vec(dbenv = 0x41c7f0, locker = 2147484655U, flags = 0, list = 0xfffffd7ffe7fd7b8, nlist = 2, elistp = 0xfffffd7ffe7fd7b0), line 116 in "lock.c"
    [6] __db_lget(dbc = 0x424ac0, action = 2, pgno = 5U, mode = DB_LOCK_WRITE, lkflags = 0, lockp = 0xfffffd7ffe7fd948), line 1006 in "db_meta.c"
    [7] __bam_search(dbc = 0x424ac0, root_pgno = 1U, key = 0xfffffd7ffe7fdc48, flags = 1410U, slevel = 1, recnop = (nil), exactp = 0xfffffd7ffe7fdadc), line 489 in "bt_search.c"
    [8] __bam_c_search(dbc = 0x424ac0, root_pgno = 0, key = 0xfffffd7ffe7fdc48, flags = 8U, exactp = 0xfffffd7ffe7fdadc), line 2479 in "bt_cursor.c"
    [9] __bam_c_get(dbc = 0x424ac0, key = 0xfffffd7ffe7fdc48, data = 0xfffffd7ffe7fdc70, flags = 8U, pgnop = 0xfffffd7ffe7fdba4), line 871 in "bt_cursor.c"
    [10] __db_c_get(dbc_arg = 0x424790, key = 0xfffffd7ffe7fdc48, data = 0xfffffd7ffe7fdc70, flags = 8U), line 689 in "db_cam.c"
    [11] __db_c_del_primary(dbc = 0x425120), line 2249 in "db_cam.c"
    [12] __db_c_del(dbc = 0x425120, flags = 0), line 285 in "db_cam.c"
    [13] __db_del(dbp = 0x41d070, txn = 0x42f5d0, key = 0xfffffd7ffe7fdf30, flags = 0), line 492 in "db_am.c"
    [14] __db_del_pp(dbp = 0x41d070, txn = 0x42f5d0, key = 0xfffffd7ffe7fdf30, flags = 0), line 485 in "db_iface.c"
    [15] Db::del(this = 0x41c708, txnid = (nil), key = 0xfffffd7ffe7fdf30, flags = 0), line 226 in "cxx_db.cpp"
    [16] Storage::del(this = 0x41c690, key = 501), line 131 in "bdb_put_del_hang.cpp"
    [17] writing_thread_func(arg = (nil)), line 173 in "bdb_put_del_hang.cpp"
    [18] thrsetup(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ffee6b40b
    [19] lwpstart(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ffee6b640
    Looks like some problems with locking, because if I set_lk_detect(DB_LOCK_DEFAULT) some methods fails with DB_LOCK_DEADLOCK, but i do not understand where is raise condition, because both threads calls just a single operations. Can anybody explain the problem?
    Here is soruce code:
    #include <set>
    #include "pthread.h"
    #include "bdb/db_cxx.h"
    static const char *__THIS_FILE__ = __FILE__;
    class Storage
    private:
    DbEnv m_bdbEnv;
    Db m_bdbLongKeys, m_bdbLongKeysSec;
    static void bdb_error_call( const DbEnv dbEnv, const char errpfx, const char *msg )
    printf( "%s\n", msg );
    static int bdb_sec_callback( Db secondary, const Dbt pkey, const Dbt pdata, Dbt skey )
    skey->set_data( pdata->get_data() );
    skey->set_size( pdata->get_size() );
    return 0;
    public:
    Storage( void )
    : m_bdbEnv( DB_CXX_NO_EXCEPTIONS ),
    m_bdbLongKeys( &m_bdbEnv, DB_CXX_NO_EXCEPTIONS ),
    m_bdbLongKeysSec( &m_bdbEnv, DB_CXX_NO_EXCEPTIONS )
    int open( const char *storageURL )
    m_bdbEnv.set_errcall( bdb_error_call );
    static const u_int32_t envFlags =
    DB_CREATE | /* create if not exists */
    DB_INIT_MPOOL | /* memory pool */
    DB_INIT_LOCK | /* locking */
    DB_INIT_LOG | /* recovery */
    DB_INIT_TXN | /* transactions */
    DB_THREAD;
    int error = m_bdbEnv.open( storageURL, envFlags, 0 );
    if (error != 0)
    m_bdbEnv.err( error, "DbEnv::open() failed." );
    return -1;
    static const u_int32_t dbFlags =
    DB_CREATE | /* create if not exists */
    DB_AUTO_COMMIT | /* auto commit */
    DB_THREAD;
    m_bdbLongKeys.set_errcall( bdb_error_call );
    error = m_bdbLongKeys.open( NULL, "longKeys.db", NULL, DB_BTREE, dbFlags, 0 );
    if (error != 0)
    m_bdbLongKeys.err( error, "Db::open() failed." );
    return -1;
    m_bdbLongKeysSec.set_errcall( bdb_error_call );
    m_bdbLongKeysSec.set_flags( DB_DUP | DB_DUPSORT );
    if (error != 0)
    m_bdbLongKeysSec.err( error, "Db::set_flags() failed (%s:%d).",
    __THIS_FILE__, __LINE__ );
    return -1;
    error = m_bdbLongKeysSec.open( NULL, "longKeys-sec.db", NULL, DB_BTREE, dbFlags, 0 );
    if (error != 0)
    m_bdbLongKeysSec.err( error, "Db::open() failed (%s:%d).",
    __THIS_FILE__, __LINE__ );
    return -1;
    error = m_bdbLongKeys.associate( NULL, &m_bdbLongKeysSec, bdb_sec_callback, DB_AUTO_COMMIT );
    if (error != 0)
    m_bdbLongKeys.err( error, "Db::associate() failed (%s:%d).",
    __THIS_FILE__, __LINE__ );
    return -1;
    return 0;
    int close( void )
    m_bdbLongKeysSec.close(0);
    m_bdbLongKeys.close(0);
    m_bdbEnv.close(0);
    return 0;
    int put( long key, long data )
    Dbt dbtKey, dbtData;
    dbtKey.set_data( (void*) &key );
    dbtKey.set_size( sizeof(key) );
    dbtData.set_data( (void*) &data );
    dbtData.set_size( sizeof(data) );
    int error = m_bdbLongKeys.put( NULL, &dbtKey, &dbtData, DB_NOOVERWRITE );
    if (error != 0)
    m_bdbLongKeys.err( error, "Db::put() failed (%s:%d)", __THIS_FILE__, __LINE__ );
    return -1;
    return 0;
    int del( long key )
    Dbt dbtKey;
    dbtKey.set_data( (void*) &key );
    dbtKey.set_size( sizeof(key) );
    int error = m_bdbLongKeys.del( NULL, &dbtKey, 0 );
    if (error != 0)
    m_bdbLongKeys.err( error, "Db::del() failed (%s:%d)", __THIS_FILE__, __LINE__ );
    return -1; }
    return 0;
    Storage *g_storage = NULL;
    static long g_numberTotal = 1000;
    static long g_numberToRead = g_numberTotal/2;
    static std::set<long> g_toRead;
    static std::set<long> g_toWrite;
    extern "C" void reading_thread_func( void arg );
    extern "C" void writing_thread_func( void arg );
    void reading_thread_func( void arg )
    std::set<long>::const_iterator it = g_toRead.begin();
    std::set<long>::const_iterator it_end = g_toRead.end();
    for (int j = 2*g_numberTotal+1; it != it_end; ++it) {
    ++j;
    if (g_storage->put(j, j) != 0)
    printf( "put() failed (%s:%d).\n", __THIS_FILE__, __LINE__ );
    return NULL;
    void writing_thread_func( void arg )
    std::set<long>::const_iterator it = g_toWrite.begin();
    std::set<long>::const_iterator it_end = g_toWrite.end();
    for (; it != it_end; it++) {
    if (g_storage->del(*it) == 0)
    printf( "Deleted key %d\n", *it );
    else
    printf( "Failed to delete key %d\n", *it );
    return NULL;
    int main( int argc, char *argv[] )
    pthread_t read_tid, write_tid;
    if (g_numberToRead > g_numberTotal)
    return 1;
    g_storage = new Storage;
    if (g_storage->open("test_storage") != 0)
    return 3;
    for (int i = 0; i < g_numberTotal; ++i) {
    if (g_storage->put(i, i) != 0)
    std::cout << "Failed to add key '" << i << "'" << std::endl;
    if (i <= g_numberToRead)
    g_toRead.insert(i);
    else
    g_toWrite.insert(i);
    pthread_create( &read_tid, NULL, reading_thread_func, NULL );
    pthread_create( &write_tid, NULL, writing_thread_func, NULL );
    pthread_join( read_tid, NULL );
    pthread_join( write_tid, NULL );
    if (g_storage != NULL) {
    g_storage->close();
    delete g_storage;
    return 0;
    }

    Hi,
    Thank you for you answer, but I still not happywith
    it.
    I attentively read the documents you providedbefore
    posted the message on the forum. Ok. Let me explain again.
    I could enclose these calls in each owntransaction
    (and I tried it, but had the same result) but itdoes
    not make a sence if DB_AUTO_COMMIT flag wasspecified
    for the Db::open()Using transaction does not necessarily eliminate the
    chance of deadlock. Practically any application that
    uses locking may deadlock. Can you post here the
    example in which you are trying it transactionally?
    And maybe I will try to correct it.The example is in the my first message. It would be nice if you could suggest a good solution to workaround the deadlock.
    There is only ONE OPERATION from the BerkeleyDBAPI
    point of view in each thread under the transaction
    and I would expect that the one single Db::put()or
    Db::del() can not cause the deadlock. Why it
    happens?Because "With the exception of the Queue access
    method, the Berkeley DB access methods do page-level
    locking." (Locking granularity:
    http://www.oracle.com/technology/documentation/berkele
    y-db/db/ref/lock/page.html)
    The only solution I see now is use
    DbEnv::set_lk_detect() and handle the
    DB_LOCK_DEADLOCK error code on each DB operationand
    retry the operation on the deadlock, but it is the
    last thing I would like to use.
    The conclusion:
    - why single API call of Db::put() or Db::del()under
    transaction made in the same time cause adeadlock?
    Because both of them will require write locks on the
    same page.
    "The first component of the infrastructure, deadlock
    detection, is not so much a requirement specific to
    transaction-protected applications, but instead is
    necessary for almost all applications in which more
    than a single thread of control will be accessing the
    database at one time. Even when Berkeley DB
    automatically handles database locking, it is
    normally possible for deadlock to occur. Because the
    underlying database access methods may update
    multiple pages during a single Berkeley DB API call,
    deadlock is possible even when threads of control are
    making only single update calls into the database."
    (Deadlock detection:
    http://www.oracle.com/technology/documentation/berkele
    y-db/db/ref/transapp/deadlock.html)
    Please let me know if this time I was clear enough.
    Bogdan Coman

  • Trouble deploying application in Tomcat!

    When I try to open the deployed application in the TomCat webserver, it throws a HTTP 404 error!
    However, the same application is working fine in NetBeans, which has a bundled TomCat server!
    Where am I going wrong? The applications that come with Tomcat are working fine, but no matter whatever appl I deploy, it isnt working!

    First, thanks for the suggestions Nick! And I have tried each of these steps you mentioned!
    1) Check your app is deployed and running in Tomcat Web Application Manager. -- YES, IT IS! I CAN SEE THE APPLICATION, RELOAD IT, STOP IT, ETC!
    2) If not deployed, check log file in logs\stdout.log to find out why it didn't deploy. (How are you deploying? Copying the war file across to \webapps?) - I TRIED DEPLOYING THE WAR FILE, THEN I DEPLOYED AN APPL CREATING THE DIRECTORY STRUCTURE, ETC! STILL NO LUCK!
    3) Make sure you're definitely hitting the correct URL (including the context path, which should also be shown in Web Application Manager) - OF COURSE I AM; EVERY APPL I DEPLOY RETURNS 404! THE NATIVE APPLICATIONS HOWEVER WORK FINE
    4) Can you deploy and run any apps in your standalone Tomcat instance? - I DIDNT GET THIS BUT AN APPL WHICH WORKS PERFECTLY FINE IN NETBEANS, ISNT WORKING IN THE STANDALONE TOMCAT!
    5) Try deploying a really simple app to see if that works. - DID & FAILED!

  • Trouble installing AutoVue - Deploying application in domain failed

    ** Repost from the AutoVue discussion group [https://forums.oracle.com/thread/2560993]
    Full Error:
    Deploying application in domain failed; Deployment Error -- Exception occurred in the wsgen process javax.xml.ws.WebServiceException: Unable to create JAXBContext Deployment Error -- Exception occurred in the wsgen process javax.xml.ws.WebServiceException: Unable to create JAXBContext.
    Sun GlassFish Enterprise Server v2.1.1
    This error occurs when ==> http://localhost:4848/ | Glassfish 2.1.1 mgt console | Web Applications | Deploy | Web Application, AutoVueWS.war
    Background:
    I am a Adobe Flex coder tossed into a Silverlight project trying to get a JavaBean to work.
    My task is to get a DGN file to display in my Silverlight app. I've attempted to solve this by using AutoVue as a web service returning an image and displaying that image on my control. This, of course is working great on the last developers machine. However, I have been totally unsuccessful in installing it on the clients server. I have no real idea what I'm doing with the Java/GlassFish/AutoVue section of this project. Any help would be greatly appreciated
    --I've have Glassfish v2.1.1 installed and seems to be working correctly.
    --I've used C:\Program Files (x86)\Java\jdk1.7.0_21\bin\jar.exe" -cvf AutoVueWS.war -C AutoVueWS .
       to compile the war file.
    --Server = Windows 7 Pro, 2gb, 64-bit *Virtual Machine
    Thanks in advance!

    Thank you so much for the reply. I will re-post this on the GlassFish Thread.
    >>Are you trying to deploy the actual AutoVue Web Services, or are you trying to deploy the AutoVue "JVue" or "VueBean" object within a Web Service?
    You know, I don't know. My only goal is to take this DGN file and turn it into something I can view in Silverlight.
    The current path, I think, is:
    IIS => Grab the DGN. Pass the DGN to Glassfish\AutoVue bean, I think that passes it on to the jVue Server. Which passes back a PNG.
    All I want is an image of the dgn. I suspect "I'm doing it wrong".
    As I've been handed a couple of directories:
    C:\oracle\AutoVueWS\
    C:\oracle\AutoVueWS\autovue_webservices   <= this contains the WAR file I've been trying to install on glassfish
    C:\oracle\AutoVueIntegrationSDK
    and
    C:\Program Files\jVue
    from which I run "C:\Program Files\jVue\bin\jvueserver.bat"
    This, of course, is working on my development machine. But I am unable to duplicate on a test Virtual Machine.
    Can I just talk to the jVueServer directly? Is there a simpler approach given the tools they have?

  • Error while deploying application on portal domain

    Hi All,
    I am getting following error while deploying application on portal domain :( :( Not sure what I am missing.......
    Anyone has any idea on this???
    <Oct 6, 2010 7:49:03 AM EDT> <Warning> <com.bea.wlw.netui.pageflow.internal.WebLogicURLTemplateFactory> <BEA-000000> <In webapp <Workshop Application>, the url template <http://{url:domain}:{url:port}/{url:path}?{url:queryString}{url:currentPage}> uses the {url:port} token. The system may not pick up the correct ports if you are using a proxy server. Consider hardcoding the ports in a production environment.>
    <Oct 6, 2010 7:49:05 AM EDT> <Error> <com.bea.p13n.util.jdbc.internal.JdbcSequencer> <BEA-000000> <Cannot allocate sequence block:
    java.sql.SQLException: Cannot call commit when using distributed transactions
    at weblogic.jdbc.wrapper.JTAConnection.commit(JTAConnection.java:349)
    at com.bea.p13n.util.jdbc.internal.JdbcSequencer.allocateSequenceBlockNewTx(JdbcSequencer.java:626)
    at com.bea.p13n.util.jdbc.internal.JdbcSequencer.getNext(JdbcSequencer.java:456)
    at com.bea.netuix.application.manager.persistence.jdbc.MarkupDefinitionDelegate.createMarkupDefinition(MarkupDefinitionDelegate.java:785)
    at com.bea.netuix.application.manager.persistence.jdbc.MarkupDefinitionManagerImpl.createMarkupDefinition(MarkupDefinitionManagerImpl.java:161)
    Truncated. see log file for complete stacktrace
    >
    <Oct 6, 2010 7:49:05 AM EDT> <Error> <netuix> <BEA-423147> <Exception [javax.transaction.TransactionRolledbackException: EJB Exception: : javax.ejb.EJBException: SQL Error while trying to createMarkupDefinition: SQL [insert into PF_MARKUP_DEFINITION ( MARKUP_DEFINITION_ID, MARKUP_NAME, MARKUP_TYPE, WEBAPP_NAME, MARKUP_FILE) values (?,?,?,?,?)] database error code [0] SQL state [null]. Possible markup duplication of [
    MarkupDefinition:
    webAppName = plassPortalWeb
    type = Menu
    name = multiLevelMenu
    file = /framework/markup/menu/multilevel.menu
    beginXml = <netuix:multiLevelMenu $(markupType) $(markupName)>
    endXml = </netuix:multiLevelMenu>
    MarkupDefinitionId = null].; nested exception is: java.sql.SQLException: Cannot call commit when using distributed transactions
    java.sql.SQLException: Cannot call commit when using distributed transactions
    at weblogic.jdbc.wrapper.JTAConnection.commit(JTAConnection.java:349)
    at com.bea.p13n.util.jdbc.internal.JdbcSequencer.allocateSequenceBlockNewTx(JdbcSequencer.java:626)
    at com.bea.p13n.util.jdbc.internal.JdbcSequencer.getNext(JdbcSequencer.java:456)
    at com.bea.netuix.application.manager.persistence.jdbc.MarkupDefinitionDelegate.createMarkupDefinition(MarkupDefinitionDelegate.java:785)
    at com.bea.netuix.application.manager.persistence.jdbc.MarkupDefinitionManagerImpl.createMarkupDefinition(MarkupDefinitionManagerImpl.java:161)
    at com.bea.netuix.application.manager.persistence.jdbc.MarkupDefinitionManager_twpn9c_EOImpl.createMarkupDefinition(MarkupDefinitionManager_twpn9c_EOImpl.java:138)
    at com.bea.netuix.servlets.repository.MenuFilePersistenceManager.onNewFile(MenuFilePersistenceManager.java:160)
    at com.bea.netuix.servlets.repository.MenuFilePersistenceManager.createUpdateMenuDefinitions(MenuFilePersistenceManager.java:267)
    at com.bea.netuix.servlets.repository.MenuFilePersistenceManager.startupSync(MenuFilePersistenceManager.java:529)
    at com.bea.netuix.servlets.repository.AbstractFilePersistenceManager$StartupSync.run(AbstractFilePersistenceManager.java:155)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at com.bea.netuix.servlets.repository.AbstractFilePersistenceManager.startup(AbstractFilePersistenceManager.java:97)
    at com.bea.netuix.servlets.repository.MenuFilePersistenceManager.onNewFiles(MenuFilePersistenceManager.java:228)
    at com.bea.netuix.poller.FrameworkPoller.newFiles(FrameworkPoller.java:256)
    at com.bea.netuix.poller.NetuixFilePoller.start(NetuixFilePoller.java:172)
    at com.bea.netuix.servlets.manager.PortalServlet.reinitInternal(PortalServlet.java:390)
    at com.bea.netuix.servlets.manager.PortalServlet.initInternal(PortalServlet.java:261)
    at com.bea.netuix.servlets.manager.PortalServlet.access$100(PortalServlet.java:125)

    Hello Everybody,
    I solved this error by myself as follows:
    So, what I did was; I started the RemoteGui.bat (C:\usr\sap\J2E\JC00\SDM\program) and from the Undeployment tab, I selected “mainapp01” and “com.sap.engine.docs.examples”.
    The reason I undeployed the above applications was because when I was trying to deploy the mainapp01 application, it gave an error saying that “: Cannot deploy application pcbp.com/mainapp01.. Reason: Application alias [/] for application [pcbp.com/mainapp01] already exists in the HTTP Provider Service. The application that holds this alias is [sap.com/com.sap.engine.docs.examples “.
    And, then I restarted the J2EE engine and from the SAP Netweaver Developer Studio, I again deployed the mainapp01 application on the local J2EE engine and it was deployed successfully.
    Oct 10, 2006 9:45:30 AM /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] INFO:
    [002]Finished Deployment
    Settings
    SDM host : RPIKOER
    SDM port : 50018
    URL to deploy : file:/C:/DOCUME1/krunalra/LOCALS1/Temp/temp9270pcbp.com~mainapp01.ear
    Result
    => successfully deployed : file:/C:/DOCUME1/krunalra/LOCALS1/Temp/temp9270pcbp.com~mainapp01.ear
    Thank You
    With Regards,
    Krunal Rana.

Maybe you are looking for

  • ABAP routine java conversion

    Hi Folks, I am in the process of converting ABAP routine into java which can work in CRM system. I would like to know what would be the java function of the xkwert. let me know the approach also to find the correct function. Thanks a lot, Sanjeev Mou

  • What are the most resource intensive Photoshop tutorials or Action Scripts

    I'm trying to benchmark some RAM on a machine, and was planning on using Photoshop as a portion of the real world tests. So I was wondering what some of the most resourse intensive, yet realistic and common things to do are. Alternatively, perhaps so

  • Play two different instruments together?

    hi all, is it possible to play/record two different instuments (MIDI) at the same time in Logic? i have a Keystation 49e (keyboard) and a padKontrol (drum pads) setup (both MIDI via USB). ideally, two people could play both instruments and be heard o

  • CDG errors

    Hi! need help from anyone who can...I am currently doing the reverse engineering...i finished the Design Capture of Server Model. Now, I am doing the Design Capture of Forms and encountered the following error: Form Generator (Windows 98/NT/2000/XP)

  • Data Guard data population issue

    Hi ... I have data guard config with a scenario that new user schema is created (couple tablespaces and datafiles). The tablespace is setup in NOLOGGING mode. After checking the physical standby server, the datafiles are created. My questions: 1. How