Java transaction library

Is JTA must be running on J2EE?
My case is:
I have two diff db schema connections and would like to commit the update at the same time.
May i know if there is any other suggestions?
Many Thx.
Jimmy

Hi Roberto,
Just in case you are still in the look for a way to resolve.
Suppose that you have the database page size set to 512B. The size of an item (key or data item) that can be stored onto a leaf page will be approximately 128B (usually calculated as page_size/4). Any item exceeding this size will be forced onto an overflow page.
[http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_conf/pagesize.html|http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_conf/pagesize.html]
[http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_misc/diskspace.html|http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_misc/diskspace.html]
The actual formula for calculating the size of an overflow item looks like this: overflow_item_size = (page_size - page_overhead) / minimum_no_of_keys * 2 - item_overhead * 2
Remember that on a Btree database page the minimum number of keys that can be stored is 2 (each record requires 2 slots, one for the key, one for the data).
Now, you can pad your key and data items so that they extend up to this limit. You can set your page size to a 512B, pad the items so that they extend up to 111B (based on the formula mentioned above) and store the records you need but with some dummy records in between, such as (key | data):
keyX<pad_bytes> | dataForKeyX<pad_bytes>
keyXX<pad_bytes> | dataForKeyXX<pad_bytes> (dummy record)
keyZ<pad_bytes> | dataForKeyZ<pad_bytes>
keyZZ<pad_bytes> | dataForKeyZZ<pad_bytes> (dummy record)
The idea is that considering that by default a lexicographical comparison routine is used by BDB for key comparison, each record you need will be distributed onto a page with an ignorable/dummy record, hence you should end up with the keys you need on different leaf pages.
You'll have to adjust the number of padding bytes according to the page size and the size of your key/data items.
Regards,
Andrei

Similar Messages

  • Java Transactions WITHOUT JTS

    Hi All:
    I am working on a project where the user can create 3d components. In our code we do this:
    - Create an object from a java class that represents the component
    - Add the object to the component collection (data model)
    - Create the 3d component with our modelling library
    - Render the component with our rendering library.
    If any of these steps fails I need to rollback the whole process (transactions). So my question is this:
    - Do you know any documentation about transactions in Java?. Any algorithm or implementation of them that I could use?
    I have been taking a look to the Java Transaction Service but that is too much for what I need and besides my application is not a J2EE application.
    Note:
    I posted a topic like this on friday but I can not find it in the forum so I suppose I didn't post it correctly. If it is there and I just duplicated I apologize.

    You probably mean this thread: http://forum.java.sun.com/thread.jspa?threadID=628989
    When you click on your nick name you'll get a list of recent posts you made. Please stay in that thread, if the question hasn't changed.

  • Set image path in java class library

    Hi,
    I created a java class library project and made .jar file. My java class library contains .jpg files in separete folder named as Images. My .jar file contains list of classes and image folder also but when i am using .jar file in applet. java class library is working but images are not shown. Let me know how to create imageicon to show images also in the class library

    ImageIcon icon = new ImageIcon(getClass().getResource(path-to-file));

  • JGSL : about java scientific library, how to use it any tutorial or etc

    Hay,
    I have a question regarding JGSL: java scientific library.
    I just download the jgsl.0.1.1 lib for my project
    It contains a bunch of file, including the lib files
    I set the lib folder path in the LD_LIBRARY_PATH and when i tried to run the testfile.class
    that comes with this library, i got an error
    main class defination not found.
    Have any one used the lib if yes can send me the working example.
    or at least tell me how to set these things, there is no documentation available with this.
    thanks

    Why don't u use a class loader. Try this code
    // loader class
    public class Loader  extends ClassLoader {
        String path;
        public Loader(String path) {
              this.path = path;
        public Class findClass(String name) {
            byte[] b = loadClassData(path+name+".class");
            return defineClass(name, b, 0, b.length);
        private byte[] loadClassData(String name) {
            File file = new File(name);
            byte[] data = null;
            try {
                InputStream in = new FileInputStream(file);
                data = new byte[ (int) file.length()];
                for (int i = 0; i < data.length; i++) {
                    data[i] = (byte) in.read();
            catch (IOException ex) {
            file = null;
            return data;
    // in your caller class use
       Loader loader = new Loader(libPath); // lib path may be taken from a command line arg
       Object main = loader.loadClass("ClassLib", true).newInstance();I think this is what u r looking for
    Uditha Nagahawatta

  • Java SSF library

    We are trying to use SSF ( digital signatures ) as authentication mechanism for Archive Link through HTTP Interface.ABAP code is generating PKCS#7 signed URL and we want to verify it using Java SSF library in an external system.SAP documentation talks about JAVA IAIK toolkit can be downloded from Service market place. I can't find it on service.sap.com. Does anybody know where can I download JAVA SSF from ?
    cheers
    Ramesh.

    Hi Aldo,
    The java packages where this classes and interfaces are implemented are:
    - com.sap.security.api.ssf
    - com.sap.security.core.server.ssf
    You can find this in the jar file tc_sec_ssf.jar.
    Also look the following SAP Help link [Secure Store and Forward Mechanism (SSF)|http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/bf6f77a2c5446a86e0152f1b309db6/frameset.htm]
    Please reward if helpful.
    Regards
    Alexandre

  • Java class library method definition is visible in debugging!!!!!

    I create a jar by using java class library project option, and when i am using it in other project, it is displaying all code inside the library, i implement security inside the java library, it contains some key ...... is there any way to hide the code? or how to hide my logic when i submit it to client...
    is there any tool for this or is there are any technique to create a dll like microsoft supply.

    rohit pathak wrote:
    thanks for your time gimbal2 ,
    I tested it and it is working fine, i choose the option
    Exclude from jar file - **/*.java
    and its worked out.could you tell me about security of this class library (.jar file) ? Although i used required code { code which omit .java file during packaging } , is this is secure? or we can get the code { key in my case } from .jar file by any java tool.As you have already noticed through your other thread - yes you can.
    how to secure code in java..

  • Java math library?

    Hi all,
    Does anyone know a java math-library which provides analysis stuff?
    I'd like to generate a function (approximation) which describes a curve.
    What I need is an implementation of Lagrange interpolation formula or
    Newton interpolation formula.
    Google lets me down. Any help would be greatly appreciated!

    You could try looking through the list of stuff at http://math.nist.gov/javanumerics/

  • Java Class Library

    What's the online Java Class Library reference site?
    I swore it was on this Java.sun.com site, but I can't seem to locate it again.
    Thanks,
    MB

    Are you looking for http://java.sun.com/j2se/1.3/docs/api/index.html by any chance ?

  • MDM 5.5 Java API Library Reference Guide

    hi friends,
    I need MDM 55 Java API Library Reference Guide  pdf file
    please forward to me
    its urgent

    That is for pdf. I thought once you're signed on here, that should work, too. However, here is the online help (same docs):
    [http://help.sap.com/saphelp_mdm550/helpdata/en/43/D7AED5058201B4E10000000A11466F/frameset.htm]
    In Programming Interfaces on the left you will find the Java API guide.

  • Third-party Java Visualization Library?

    Hello,
    I am going to develop a Java Application which needs to draw some charts, like annotated line. Structure of data is simple that only datetime and value are included, but amount of data is huge. I am new to Java Visualization and can someone give me some advices on this issue? Which will Java Visualization Library suit to my requirement?
    P.S. Free library would be better.

    J.Yang wrote:
    I am going to develop a Java Application which needs to draw some charts, like annotated line. No problem; plenty of libraries out there. I use JFreeChart from www.jfree.org.
    Structure of data is simple that only datetime and value are included, but amount of data is huge. Then you start to have a problem.
    I am new to Java Visualization and can someone give me some advices on this issue? If you have a very very large dataset and you are charting time series then your charts will be cluttered. You will have to in some way reduce the data to a more reasonable size so that you are plotting no more than 1 point per pixel along the time axis. My approach to this is to condense the data into three lines. The primary line breaks the time into a smaller number of segments (500 or so) and computes the average value for each segment and plots this average. You then create two secondary lines which use the same segments but compute the minimum and maximum value for each segment and you then plot the line of minimums and the line of maximums.
    Be aware that this condensing of the data must be done outside the event thread.
    Which will Java Visualization Library suit to my requirement?
    P.S. Free library would be better.

  • Oracle Spatial Java Class Library Download?

    Hello,
    where can I download the Oracle Spatial Java Class Library? I installed OracleXE which can handle SDO_GEOMETRY types and now need the java library for programming against the database.
    greetings
    Peter

    If you mean by samples that show you how to manipulate Geometry types than you can find this tutorial using java and connecting to your DB via Oracle Spatial Network Data Model (NDM) https://spatial.samplecode.oracle.com/servlets/ProjectProcess?pageID=0Zl7oV
    My personal experience, it would be good idea to have oracle 11g Release 2 installed.
    It shows you different ways to query spatial data. You might also be interested in this documentation on oracle Topology and NDM Developers guide: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28399.pdf

  • Java Class Library (SDOAPI)

    Greetings,
    Using Oracle Spatial Java Class Library (SDOAPI) GeometryAdapter.importGeometry method on the following geometry causes a InvalidGeometryException to be thrown.
    SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1),
    SDO_ORDINATE_ARRAY(27.3384, 81.4328, 0, 587581.22, 4789617.17, 0))
    This geometry appears to be valid according to the SDO_GEOM.VALIDATE_LAYER and SDO_GEOM.VALIDATE_GEOMETRY functions.
    How can this geometry be read using the SDOAPI?
    Thanks,
    Jeff

    Daniel,
    Thank you for the prompt response and valuable information. My registration contains my accurate e-mail address. Please notify as soon this bug fix is available.
    Thank You,
    Jeff

  • Java networking library with RMI-like functionality?

    Is anyone aware of a Java networking library, that provides RMI like functionality and TCP/IP with an intuitive API and minimal coding required? I'm working on a prototype, but I'm having difficulty getting Java's RMI functionality working through Netbeans, so while I'm prototyping I'm looking for alternatives so I can code more and frustrate less!
    Thanks

    BobCrivens wrote:
    Thanks ejp.
    I guess I'll re-phrase the original question. Is there a small open-source Java networking library that doesn't include RMI, but gives a simple API for TCP/IP connections (higher level than sockets) and includes file transfer? I don't know if I need things like FTP/HTTP/POP/SMTP support etc for now.
    ThanksI gotta be honest with you here. I think you need to stop coding for now and get your requirements in hand with a better grasp on how network programming works.
    Not being insulting here but your questions show your current knowledge level on the subject to be not really sufficient for success with whatever it is you want to do.
    There is the networking tutorial available here http://java.sun.com/docs/books/tutorial/networking/index.html but it might do you well to tell us exactly what you are trying to do. Are you trying to build an FTP client? Are you trying to build a whole client/server program of some sort?
    Because everything now is very vague. You seem to be looking for protocols or API's between TCP and things like FTP for example and none exist because these sit directly on top of TCP. So you either deal directly with the Sockets or you deal with some library that deals with the protocol in question. There isn't an "in-between" layer here.

  • Where can I downlaod java swing library for JDk?

    where can I downlaod java swing library for JDk?

    Are you sure you don't have Swing? It comes with the JDK. If you don't have it, look at http://java.sun.com/products/jfc/download.html
    If you are using JDK 1.1, you can download Swing alone - but be aware that this is an old version. You would be best advised to download the Java SDK 1.3.1, which includes Swing 1.1.
    Regards,
    Matt

  • Java SSF Library - interface  ISsfData and class SsfDataXML

    Hello all,
    Can anybody tell me in which Java library I can find the interface ISsfData and class SsfDataXML used in the following example (see link)?
    http://help.sap.com/saphelp_nw70/helpdata/EN/a4/d0201854fb6a4cb9545892b49d4851/frameset.htm
    Which JAR file(s) contain these libraries?  It is described as the Java SSF Library...
    I would like to copy this file locally and add it as an External Library to an Eclipse project.
    Many thanks,
    Aldo

    Hi Aldo,
    The java packages where this classes and interfaces are implemented are:
    - com.sap.security.api.ssf
    - com.sap.security.core.server.ssf
    You can find this in the jar file tc_sec_ssf.jar.
    Also look the following SAP Help link [Secure Store and Forward Mechanism (SSF)|http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/bf6f77a2c5446a86e0152f1b309db6/frameset.htm]
    Please reward if helpful.
    Regards
    Alexandre

Maybe you are looking for

  • Save Scenario Script not Working

    Hi Gurus, I have a quick doubt here. Need help on it ASAP. Its been a while since I started with the bookmark functionality. This is the Error I am getting. Multiple markers at this line - Couldn't resolve reference to Member 'saveBookmark'. - missin

  • Kernelbase.dll crash

    Hi Everyone, A Labview application I recently wrote crashed due to an error (code e0434352) in Kernelbase.dll. It had been running for several weeks, so the error really isn't reproducible, but the application is meant to run without any human interv

  • How to duplicate (finished) iMovie Project?

    Hello, I went on vacation with my wife and we shot some video all around town. I've put together all of the footage and trimmed the video, tweaked the audio, etc. for OUR video archive. The project comes in at just under an hour. Our friends want to

  • Remove Extstension of File Name

    Hi How can i remove the .seq exstention off of the sequence file name. I want to display this name in the Header of the Report. Help share your knowlegde Solved! Go to Solution.

  • SD - 3rd party processing invoice creation

    Hello Friends I have created a sales order for 3rd party procesing and then created a PO with ref to PR. And now i am trying to create an invoice to customer , but my question is can i go head do the Invoice without doing GR , because we are not doin