Oracle9iAS Java Edition

Hi,
I am interested in installing Oracle9iAS Java edition on Red Hat Linux 9. Has anybody done so ? My previous attempt was unsuccessfull.
Any pointers / help would be appreciated.
Regards
Abhijeet

Having SecurityExceptions because the user does not have the rigth permissions, is strange, because I was installing everything in the user home directory.
So the only problem I can see, was permissions to write in the /tmp directory. I checked that the user also as write permissions in that directory.
Looking in the logs files I noticed that Oracle is passing the -Djava.io.tmpdir parameter, when no environment values is used for TMP or TMPDIR, when deploying applications in OC4J:
Launched configuration tool OC4J Instance Configuration Assistant
Command which is being spawned is /export/data01/o9ias/jdk/bin/java -Djava.io.tmpdir= -mx512M -classpath ...
If Oracle should not specify the -Djava.io.tmpdir=, then everything worked out of the box.
I defined the environment variables (in the shell) TMP, TMPDIR, so that in the -Djava.io.tmpdir= was replaced by -Djava.io.tmpdir=<my temp dir>. With this the deployments that failed, now worked.
After this another problem. Oracle HttpServer fails to start. Looking in the loges, some modules are configured to be loaded, but are not found:
mod_ossl.so
mod_oradav.so
modplsql.so
Commenting this modules, makes http server start. Shouldn't this be commented in the Java Edition?
The only problem I have know is the make of ins_sqlplus.mk, ins_oemagent.mk and ins_calypso.mk. Can anyone help me on this, or at least explain us why this is needed?
thanks,

Similar Messages

  • Oracle9iAS Java Edition v9.0.3 instalattion on SuSE 8.2

    The OC4J "standalone" edition was simple.
    With the Oracle9iAS Java Edition v9.0.3 instalation bundle, it comes with other funcionalites (Oracle HTTP server, enterprise console, and other), and with many many problems.
    I have tested the installation under SuSE 8.2 Professional and the installation fails.
    The following makefiles can't be executed (no error appears, and i have the korn shell installed)
    ins_sqlplus.mk
    ins_oemagent.mk
    ins_calypso.mk
    The installation of OC4J home instance, fails with a security exception when creating some unix file.
    The deployments of application in the OC4J_demo instance also fails with exception:
    java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.checkAndCreate(File.java:1157)
    at java.io.File.createTempFile(File.java:1242)
    at java.io.File.createTempFile(File.java:1279)
    at oracle.ias.sysmgmt.deployment.j2ee.console.J2eeDeploymentImpl.fetchEar(J2eeDeploymentImpl.java:704)
    at oracle.ias.sysmgmt.deployment.j2ee.console.J2eeDeploymentImpl.getEarDeployer(J2eeDeploymentImpl.java:281)
    at oracle.ias.sysmgmt.deployment.j2ee.console.J2eeDeploymentImpl.getEarDeployer(J2eeDeploymentImpl.java:258)
    at oracle.j2ee.tools.deploy.Oc4jDeploy.deploy(Oc4jDeploy.java:518)
    at oracle.j2ee.tools.deploy.Oc4jDeploy.main(Oc4jDeploy.java:138)

    Having SecurityExceptions because the user does not have the rigth permissions, is strange, because I was installing everything in the user home directory.
    So the only problem I can see, was permissions to write in the /tmp directory. I checked that the user also as write permissions in that directory.
    Looking in the logs files I noticed that Oracle is passing the -Djava.io.tmpdir parameter, when no environment values is used for TMP or TMPDIR, when deploying applications in OC4J:
    Launched configuration tool OC4J Instance Configuration Assistant
    Command which is being spawned is /export/data01/o9ias/jdk/bin/java -Djava.io.tmpdir= -mx512M -classpath ...
    If Oracle should not specify the -Djava.io.tmpdir=, then everything worked out of the box.
    I defined the environment variables (in the shell) TMP, TMPDIR, so that in the -Djava.io.tmpdir= was replaced by -Djava.io.tmpdir=<my temp dir>. With this the deployments that failed, now worked.
    After this another problem. Oracle HttpServer fails to start. Looking in the loges, some modules are configured to be loaded, but are not found:
    mod_ossl.so
    mod_oradav.so
    modplsql.so
    Commenting this modules, makes http server start. Shouldn't this be commented in the Java Edition?
    The only problem I have know is the make of ins_sqlplus.mk, ins_oemagent.mk and ins_calypso.mk. Can anyone help me on this, or at least explain us why this is needed?
    thanks,

  • 404 Error Downloading Oracle9iAS Java Edition 9.0.3 for Windows NT/2000

    When I click on the 9iAS_Java_Windows.zip from the Oracle9iAS download page (http://www.oracle.com/technology/software/products/ias/htdocs/javasoft.html) I get redirected to the following URL which gives me a 404 page not found error:
    https://profile.oracle.com/jsp/realms/otnLogin.jsp?remoteIp=129.196.226.71&globalId=&redirectUrl=http%3a%2f%2fdownload-west.oracle.com%3a80%2fotn%2fnt%2fias%2f9iAS%2f903%2f9iAS_Java_Windows.zip
    However, if I log in, such as to post this article, this redirection does not happen and I am able to download the file successfully. I assume this may be the same problem some of the other users are experiencing with being unable to download...

    So in other words, if you are logged out and try to access this URL, you are not prompted to login? You just get an error message?

  • Oracle9iAS java edition v9.0.3 installer problem on solaris

    Hi All
    I have downloaded Oracle9ias and when i try to run the installer it complains that /etc/hosts and some other files in /etc directory do not have the entries in the specified format.
    I checked /etc/hosts it has entry in the same format as required by the installer.
    Can any one please tell me where the problem is
    - kumar

    in the hostname file you must have the ip and the alias
    for example
    192.168.1.2 iasbi.oracle.com iasb1
    192.168.1.3 infra.oracle.com infra
    first is the ip, then the servername with domain, then the alias.
    hope this will help you

  • OC4J - Java Edition

    Hello All!
    I've just downloaded the Oracle9iAS Java Edition and I want to make a lightweight installation. I did the typical installation in my computer and it is way too heavy...
    Is it mandatory to install Oracle HTTP Server? Could I just install the OC4J container? Is it possible to use IIS as webserver (I can do it with Tomcat...)?
    What is the way to manage/admin/deploy my applications?
    Thanks.

    Hi,
    If you require a lightweight installation then OC4J should be the right choice for you. OC4J contains its own Web Server accessible from a web browser using http://localhost:<portnumber>/
    The default port is 8888.
    For more information on deploying and managing your applications using OC4J refer to OC4J's User Guide
    For more resources on OC4J refer here
    Hope this helps.
    Sujatha.
    http://otn.oracle.com/sample_code/content.html

  • Can multiple threads share the same cursor in berkeley db java edition?

    We use berkeley db to store our path computation results. We now have two threads which need to retrieve records from database. Specifically, the first thread accesses the database from the very beginning and read a certain number of records. Then, the second thread needs to access the database and read the rest records starting from the position where the cursor stops in the first thread. But, now, I cannot let these two threads share the same cursor. So, I have to open the database separately in two threads and use individual cursor for each thread. This means I have to in the second thread let the cursor skip the first certain number of records and then read the rest records. However, in this way, it is a waste of time letting the second thread skip a certain of records. It will be ideal for us that the second thread can start reading the record just from the place where the first thread stops. Actually, I have tried using transactional cursor and wanted to let the two threads share the same transactional cursor. But it seems that this didn't work.
    Can anyone give any suggestion? Thank you so much!
    sgao

    If your question is really about using the BDB Java Edition product please post to the JE forum:
    Berkeley DB Java Edition
    If your question is about using the Java API of the BDB (C-based) product, then this is the correct forum.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Java edition compatible with standard edition?

    Hi
    I have a database created using Java edition 3.2.44
    I want to write an application in C++ which reads this database using the standard Berkeley DB (possibly at the same time as the java application is also accessing them). Are the database files compatible?
    I'm not too hopeful since the the database files are named something like 00000000.jdb and je.lck.
    Any help appreciated
    Nick

    Hi Nick,
    This FAQ entry addresses this question:
    [http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#2|http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#2]
    (a small additional information to this entry is that DPL API has been introduced for BDB as well in 4.7.25)
    As explained, the on-disk format for the database files is different. You should dump the database created with JE (using the DbDump/com.sleepycat.je.util.DbDump utility: [http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/je/util/DbDump.html|http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/je/util/DbDump.html]) and load it using BDB before opening it in a a program using one of the BDB APIs (using the db_load utility: [http://www.oracle.com/technology/documentation/berkeley-db/db/utility/db_load.html|http://www.oracle.com/technology/documentation/berkeley-db/db/utility/db_load.html] )
    If you face any issues with dumping/loading the database let me know.
    Regards,
    Andrei

  • DB High Availability - Java Edition

    I am using Berkeley DB Java Edition to do writes and reads to my database. I am planning on having a cluster of databases with HA feature. I noticed that the feature set for Berkeley DB Java Editon does not include High Availabilty.
    I did check the C example code that is available in the 4.4 version. I understand that I need to build a communication infrastructure in Java for master and replicated db's. Is there any example that I can follow, or any other materials available for doing HA in Java?

    I believe the answer in java replication example is relevant for you.
    <p>
    Please note that you should be able to build the communication infrastructure in C, and then still access DB via the Java interface layer from your Java program. (I.e., your communication infrastructure doesn't have to be in Java.)
    <p>
    Also, I hope it's clear that Berkeley DB Java Edition is a separate product. This is different from using Berkeley DB via its Java interface layer.
    <p>
    Alan Bram<br>
    Oracle

  • Use java edition and native edition at same time in a single java app

    Hi
    I have a situation where I need to use both versions of berkeley Db at the same time. I have an external library that I use that requires the Java edition and my own code that uses the native version. Unfortunately the source code of the library is not available and I don't want to redesign my program to use the Java edition.
    Some packages in je.4.0.103.jar and db.jar (version 5.1) contain the same naming structure and same classes eg. com.sleepycat.persist.EntityStore. I removed the duplicated packages in je.4.0.103.jar However it seems that the implementation is slightly different between the two version as I get
    java.lang.NoSuchMethodError: com.sleepycat.persist.EntityStore.<init>(Lcom/sleepycat/je/Environment;Ljava/lang/String;Lcom/sleepycat/persist/StoreConfig;)V
    When I simply had both versions available my code for the native version kept using the packages from the Java edition and the external library kept on using the native version and as a result I got loads of runtime errors.
    So how do I tell them apart. The problem is because both sets of packages have identical names and class names so Java does not know which ones to use. I am using eclipse so maybe there is some option where I can tell certain classes to use certain packages.
    Any ideas?

    Hi,
    We don't officially support using BDB and BDB JE from the same JVM process.
    It's possible to work around this limitation by creating two [url http://download.oracle.com/javase/1.4.2/docs/api/java/lang/ClassLoader.html] Java Classloaders  that load one of the two jar files. When calling BDB or BDB JE methods, the call must be bracketed with calls like this that cause the correct classloader to be used:
    ClassLoader saveLoader = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(/* specify correct loader for BDB or BDB JE here */);
    try {
       // do something with BDB or BDB JE
    } finally {
      Thread.currentThread().setContextClassLoader(saveLoader);
    }We are not experts on classloaders and we don't have an example of doing this. We have not done it ourselves, we only know that users have done it.
    I hope this helps.
    Regards,
    Alex Gorrod
    Oracle Berkeley DB

  • Compatibility issues between Berkeley DB Java Edition and Berkeley DB

    We are trying to use both Berkeley DB Java Edition and Berkeley DB (Java/C) in one of our projects. However, they share the common classes (i.e. EntryDingin.java), but with their own different impementation. Is there any reason that they have to share the same names/packages? Can we request to have the shared java classes going into different packages?
    Thanks
    Yao

    Hello Yao,
    You're correct and the DB and JE products were not designed to run under the same classloader in the same JVM. It is very unlikely that we'll be changing the package names, since that would be very disruptive and yet have no value for the overwhelming majority of users. We will note your request, however, for future reference.
    The two workarounds I know of are:
    1. Use a separate classloader for the use of each product.
    2. Use a tool such as jarjar links (http://code.google.com/p/jarjar/) to rename the packages in one or both of the products.
    Option 2 is not something we (the JE team members) have experience with, but it was used successfully by a JE user. The user also pointed out a bug in the jarjar tool to be aware of: http://code.google.com/p/jarjar/issues/detail?id=21
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Using Oracle Berkeley DB Java Edition RELEASE 3.2

    Hi,
    I am completely new to Oracle. I intend to use Oracle Berkeley DB Java Edition RELEASE 3.2., in conjunction with Java.
    Can some one help me figure out what documentation I should use, and the learning path ?
    Any suggestions would be greatly appreciated.
    Thanks
    Ravi Banthia
    Kolkata

    Please refer
    http://www.oracle.com/technology/products/berkeley-db/je/index.html

  • Patch Release: Berkeley DB Java Edition 4.0.117

    Berkeley DB Java Edition 4.0.117
    http://www.oracle.com/us/products/database/berkeley-db/index.html
    http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html
    http://www.oracle.com/technetwork/database/berkeleydb/overview/persistence-160890.html
    http://www.oracle.com/technetwork/database/berkeleydb/overview/index-093405.html
    Berkeley DB Java Edition 4.0.117 is a patch release consisting of many important fixes. We strongly recommend that users of the 4.0.x upgrade to this release. Those using 4.1.x need not be concerned with this patch release.
    The critical patch fixes:
    [#19422] - Fixes a bug that prevents recovery if CacheMode.EVICT_BIN is used.
    The complete list of changes is in the change log page.
    http://download.oracle.com/otndocs/products/berkeleydb/html/je/je-40117-changelog.html
    Product documentation can be found at:
    http://download.oracle.com/docs/cd/E17277_02/html/index.html
    Download the source code including the pre-compiled JAR, complete documentation, and the entire test suite as a single package.
    http://download.oracle.com/berkeley-db/je-4.0.117.zip
    http://download.oracle.com/berkeley-db/je-4.0.117.tar.gz
    Common questions are addressed in our FAQ that you can find here:
    http://www.oracle.com/technetwork/database/berkeleydb/je-faq-096044.html
    Then join OTN and participate in the Berkeley DB JE Support Forum discussions. Our engineering and support staff are highly active on these forums, if you have questions please ask them there first.
    Berkeley DB Java Edition
    For further information, or questions about licensing and sales of JE, please contact us at:
    mailto:[email protected]
    Thank you for your support of Berkeley DB Java Edition.

    Hi Kristoffer,
    We have never updated Maven central -- I think someone else, perhaps who is reading the forum, did that for 5.0.73.  We should update it, but we don't quite have our act together on that.  Hopefully we'll have more info on that soon, but for now you'll need to just copy the jar file or use the Oracle maven repo.
    You should definitely read the release notes and the change log, and decide whether to upgrade.
    BDB has both a commercial and an OSS license.  Due to Oracle policy BDB does not have some of the things you might expect from an OSS project:
    - bug system is not exposed
    - roadmap is not published
    - code contributions are fairly rare, mostly due to the nature of the code -- it's a database engine, and is fairly difficult to change casually.
    What other questions about the process do you have?  I wasn't sure exactly what you wanted to know.
    --mark

  • Oracle Berkeley DB Java Edition High Availability (White Paper)

    Hi all,
    I've just read Oracle Berkeley DB Java Edition High Availability White Paper
    http://www.oracle.com/technetwork/database/berkeleydb/berkeleydb-je-ha-whitepaper-132079.pdf
    In section "Time Consistency Policy" (Page 18) it is written:
    "Setting a lag period that is too small, given the load and available hardware resources, could result in
    frequent timeout exceptions and reduce a replica's availability for read operations. It could also increase
    the latency associated with read requests, as the replica makes the read transaction wait so that it can
    catch up in the replication stream."
    Can you tell me why those read operations will not be taken by the master ?
    Why will we have frequent timeout ?
    Why should read transaction wait instead of being redirect to the master ?
    Why should it reduce replica's availability for read operations ?
    Thanks

    Please post this question on the Berkeley DB Java Edition (BDB JE) forum Berkeley DB Java Edition. This is the Berkeley DB Core (BDB) forum.
    Thanks,
    Andrei

  • Berkeley DB Java Edition and Java 1.4

    As a Berkeley DB Java Edition user we place a very high value on your input. We need your feedback regarding a product requirement for Java 1.5.
    As time goes on we find ourselves implementing more and more performance enhancements based on facilities found only Java 1.5, primarily in the java.util.concurrent package. When we make these enhancements, we currently also maintain support for Java 1.4 although not at the same level of performance. Maintaining and testing this dual mode operation is beginning to slow down our development process. We would like to move as quickly as possible to take advantage of Java 1.5 performance features, but we are constrained by maintaining support for Java 1.4.
    We are therefore planning to require Java 1.5 in the next major release of Berkeley DB Java Edition. Before finalizing this plan, we need your input on whether Java 1.4 support is important to you. Please let us know what your needs are by replying to this forum message.
    Thanks.
    The Java Edition team

    Morgan,
    Yes, we currently plan to only offer replication for Java 1.5. Our motivations are split between the speed consideration and the codeline issues. We've seen better performance with 1.5. Also taking full advantage of the type safety and concurrent support in 1.5 can end up affecting implementation choices significantly, and can make 1.4 code and 1.5 code diverge a lot.
    As for bug fixing on the 1.4 releases, we don't yet have an official plan. We care very much about supporting our open source users and have been able to provide backwards patches where critical in the past. However, the cost of backporting between 1.5 and 1.4 may be high for some bug fixes, and we'll probably have to decide case by case.
    Regards,
    Linda

  • Berkeley DB Java Edition (JE) and JRuby Interoperability

    I finally got around to doing a quick test of calling Berkeley DB Java Edition (JE) from JRuby (JRuby is a 100% pure-Java implementation of Ruby).
    Before we get to JE and JRuby you probably want to know the answer to this question: "Why you would want to run Ruby on a JVM?" The answer is threefold:
    1. Ruby Performance. A large amount of effort has been put into tuning contemporary JVMs (e.g. Hotspot, Java 6, etc.) and Ruby programmers (through JRuby) can benefit from these tuning efforts. The JRuby guys have set a goal to make JRuby the fastest Ruby implementation available and Sun is certainly throwing their weight behind that effort.
    2. Portability. JRuby is a Ruby interpreter that runs anywhere a Java 5 JVM runs. You download it as a single tar.gz and it will run pretty much anywhere.
    3. Legacy Code. JRuby makes legacy Java apps and libraries available to Ruby programmers (did you ever think you'd see the word "legacy" next to the word "Java"?).
    JE interoperability with JRuby is important because it means that Ruby programmers now have a simple, embeddable, ACID storage engine (JE) available to them.
    To test this interoperability, I cobbled together a simple Ruby test program which does the following:
    * Opens an Environment, Database, and Transaction
    * Creates 10 records with keys 1..10 and marshaled Ruby Time instances as the corresponding data. This uses the Ruby Marshal package for the data binding and the JE Integer binding on the key side. There's no reason why you couldn't use different marshaling packages or methods for keys and data.
    * Commits the transaction,
    * Performs a Cursor scan to read those 10 records and prints out the Time instances, and
    * Searches for and reads the record with key 5 (an arbitrary key) and prints out the Time instance that is the corresponding data
    By the way, hats off to the JRuby developers: all of this code "just worked", out of the box, and most of my two hour investment was spent learning enough basic Ruby to make it all work. If you already know Ruby and JE, then demonstrating this interoperability would take you all of about 10 minutes.
    This was all done at the "base API" level of JE and no modifications to JE were required. I used Transactions in my code, but there's no reason that you need to. Mark and I have been talking about how to integrate JE's Direct Persistence Layer (DPL) with JRuby and we think it can be done with some remodularization of some of the DPL code. This is exciting because it would provide POJO ACID persistence to Ruby programmers.
    Linda and I have been talking about whether it makes sense to possibly use Ruby as a scripting platform for JE in the future. Given how easy it was to bring up JE and JRuby, this certainly warrants some further thought.
    The Ruby code and corresponding output is shown below. By the way, if you see something that I didn't do "The Ruby Way", feel free to let me know.
    I'd love to hear about your experiences with JE and JRuby. Feel free to email me a charles.lamb at <theobviousdomain dot com>.
    require 'java'
    module JESimple
      require 'date'
      # Include all the Java and JE classes that we need.
      include_class 'java.io.File'
      include_class 'com.sleepycat.je.Cursor'
      include_class 'com.sleepycat.je.Database'
      include_class 'com.sleepycat.je.DatabaseConfig'
      include_class 'com.sleepycat.je.DatabaseEntry'
      include_class 'com.sleepycat.je.Environment'
      include_class 'com.sleepycat.je.EnvironmentConfig'
      include_class 'com.sleepycat.je.OperationStatus'
      include_class 'com.sleepycat.je.Transaction'
      include_class 'com.sleepycat.bind.tuple.IntegerBinding'
      include_class 'com.sleepycat.bind.tuple.StringBinding'
      # Create a JE Environment and Database.  Make them transactional.
      envConf = EnvironmentConfig.new()
      envConf.setAllowCreate(true)
      envConf.setTransactional(true)
      f = File.new('/export/home/cwl/work-jruby/JE')
      env = Environment.new(f, envConf);
      dbConf = DatabaseConfig.new()
      dbConf.setAllowCreate(true)
      dbConf.setSortedDuplicates(true)
      dbConf.setTransactional(true)
      db = env.openDatabase(nil, "fooDB", dbConf)
      # Create JE DatabaseEntry's for the key and data.
      key = DatabaseEntry.new()
      data = DatabaseEntry.new()
      # Begin a transaction
      txn = env.beginTransaction(nil, nil)
      # Write some simple marshaled strings to the database.  Use Ruby
      # Time just to demonstrate marshaling a random instance into JE.
      for i in (1..10)
        # For demonstration purposes, use JE's Binding for the key and
        # Ruby's Marshal package for the data.  There's no reason you
        # couldn't use JE's bindings for key and data or visa versa or
        # some other completely different binding.
        IntegerBinding.intToEntry(i, key)
        StringBinding.stringToEntry(Marshal.dump(Time.at(i * 3600 * 24)),
                                    data)
        status = db.put(txn, key, data)
        if (status != OperationStatus::SUCCESS)
          puts "Funky status on put #{status}"
        end
      end
      txn.commit()
      # Read back all of the records with a cursor scan.
      puts "Cursor Scan"
      c = db.openCursor(nil, nil)
      while (true) do
        status = c.getNext(key, data, nil)
        if (status != OperationStatus::SUCCESS)
          break
        end
        retKey = IntegerBinding.entryToInt(key)
        retData = Marshal.load(StringBinding.entryToString(data))
        dow =
        puts "#{retKey} => #{retData.strftime('%a %b %d')}"
      end
      c.close()
      # Read back the record with key 5.
      puts "\nSingle Record Retrieval"
      IntegerBinding.intToEntry(5, key)
      status = db.get(nil, key, data, nil)
      if (status != OperationStatus::SUCCESS)
        puts "Funky status on get #{status}"
      end
      retData = Marshal.load(StringBinding.entryToString(data))
      puts "5 => #{retData.strftime('%a %b %d')}"
      db.close
      env.close
    end
    Cursor Scan
    1 => Fri Jan 02
    2 => Sat Jan 03
    3 => Sun Jan 04
    4 => Mon Jan 05
    5 => Tue Jan 06
    6 => Wed Jan 07
    7 => Thu Jan 08
    8 => Fri Jan 09
    9 => Sat Jan 10
    10 => Sun Jan 11
    Single Record Retrieval
    5 => Tue Jan 06

    In my previous post (Berkeley DB Java Edition in JRuby), I showed an example of calling JE's base API layer and mentioned that Mark and I had been thinking about how to use the DPL from JRuby. Our ideal is to be able to define classes in Ruby, annotate those class definitions with DPL-like annotations, and have the JE DPL store them. There are a number of technical hurdles to overcome before we can do this. For instance, Ruby classes defined in JRuby do not map directly to underlying Java classes; instead they all appear as generic RubyObjects to a Java method. Granted, it would be possible for the DPL to fish out all of the fields from these classes using reflection, but presently it's just not set up to do that (hence the modification to the DPL that I spoke about in my previous blog entry). Furthermore, unlike Java, Ruby allows classes to change on the fly (add/remote new fields and methods) causing more heartburn for the DPL unless we required that only frozen Ruby classes could be stored persistently.
    On thinking about this some more, we realized that there may be a way to use the DPL from JRuby, albeit with some compromises. The key to this is that in JRuby, if a Java instance is passed back to the "Ruby side" (e.g. through a return value or by calling the constructor for a Java class), it remains a Java instance, even when passed around in JRuby (and eventually passed back into the "Java side"). So what if we require all persistent classes to be defined (i.e. annotated) on the Java side? That buys us the standard DPL annotations (effectively the DDL), freezes the classes that the DPL sees, and still lets us benefit from the POJO persistence of the DPL. All of this can be done without modification to JE or the DPL using the currently available release. I cooked up a quick example that builds on the standard "Person" example in the DPL doc and included the code below.
    require 'java'
    module DPL
      require 'date'
      # Include all the Java and JE classes that we need.
      include_class 'java.io.File'
      include_class 'com.sleepycat.je.Environment'
      include_class 'com.sleepycat.je.EnvironmentConfig'
      include_class 'com.sleepycat.persist.EntityCursor'
      include_class 'com.sleepycat.persist.EntityIndex'
      include_class 'com.sleepycat.persist.EntityStore'
      include_class 'com.sleepycat.persist.PrimaryIndex'
      include_class 'com.sleepycat.persist.SecondaryIndex'
      include_class 'com.sleepycat.persist.StoreConfig'
      include_class 'com.sleepycat.persist.model.Entity'
      include_class 'com.sleepycat.persist.model.Persistent'
      include_class 'com.sleepycat.persist.model.PrimaryKey'
      include_class 'com.sleepycat.persist.model.SecondaryKey'
      include_class 'com.sleepycat.persist.model.DeleteAction'
      include_class 'persist.Person'
      include_class 'persist.PersonExample'
      # Create a JE Environment and Database.  Make them transactional.
      envConf = EnvironmentConfig.new()
      envConf.setAllowCreate(true)
      envConf.setTransactional(true)
      f = File.new('/export/home/cwl/work-jruby/JE')
      env = Environment.new(f, envConf);
      # Open a transactional entity store.
      storeConfig = StoreConfig.new();
      storeConfig.setAllowCreate(true);
      storeConfig.setTransactional(true);
      store = EntityStore.new(env, "PersonStore", storeConfig);
      class PersonAccessor
        attr_accessor :personBySsn, :personByParentSsn
        def init(store)
          stringClass = java.lang.Class.forName('java.lang.String')
          personClass = java.lang.Class.forName('persist.Person')
          @personBySsn = store.getPrimaryIndex(stringClass, personClass)
          @personByParentSsn =
            store.getSecondaryIndex(@personBySsn, stringClass, "parentSsn");
        end
      end
      dao = PersonAccessor.new(store)
      dao.init(store)
      personBySsn = dao.personBySsn
      person = Person.new('Bob Smith', '111-11-1111', nil)
      personBySsn.put(person);
      person = Person.new('Mary Smith', '333-33-3333', '111-11-1111')
      personBySsn.put(person);
      person = Person.new('Jack Smith', '222-22-2222', '111-11-1111')
      personBySsn.put(person);
      # Get Bob by primary key using the primary index.
      bob = personBySsn.get("111-11-1111")
      puts "Lookup of Bob => #{bob.name}, #{bob.ssn}"
      children = dao.personByParentSsn.subIndex(bob.ssn).entities()
      puts "\nRetrieving children of Bob"
      while (true) do
        child = children.next()
        break if child == nil
        puts "#{child.name}, #{child.ssn}"
      end
      children.close()
      store.close
      env.close
    end

Maybe you are looking for

  • Acrobat 11.01.10 Mac OS 10.8.5 Crashes when opening preferences or making annotations

    I noticed my MacBook Air (2 GHz Intel Core i7 8 GB Memory) was opening Acrobat Pro 8 rather than Acrobat Pro 11 -- I had installed the latter but at some point had starting defaulting to the former. So I deleted Acrobat Pro 8 and began using just XI.

  • How to read the file name....

    Hello all, I have a doubt on reading file name. I have 10 pdf files in the dir '/d01/tem/' I need to get/load those 10 file names using PL/SQL. Meaning I need to get the file names only not the file contents... Please help me to achieve this.... Than

  • JDBC : ODBC Datasource

    Currently we are using the jdbc:odbc to connect to a database. basically - forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); props.setProperty("user", "xxx"); props.setProperty("password", "xxx"); return DriverManager.getConnection(URL, props);

  • Is there a shorter way

    I have to calculate the price of a sandwich with the selected toppings Is there a shorter way to write the bereken_teBetalen method without changen code outside the method public class Topping {      * Alle toppings zijn opgenomen in toppingWaarden. 

  • Html_editor above 32767

    Hi, You can include data on an item html_editor or text_area above 32767? Regards. Silvio