Autoscroll behavior during DnD in JTree, 1.4 vs 1.6

The following code compiles under both Java 1.4 and Java 1.6. I'm wondering if anyone knows why the following actions cause different behaviors between the two versions:
1. When the frame opens, you should see a fully-expanded tree (which, because of the small size, causes a vertical scrollbar to appear).
2. Make a drag-and-drop gesture on the first child node ("blue"), and attempt to cause the tree to scroll down so you can drop it on the last parent node ("food").
Under 1.6, the tree scrolls nicely as you hold the DnD gesture.
Under 1.4, the tree does not scroll. I had some hope JTree.setAutoscrolls(true) would help, but it did not.
Any suggestions how to get 1.4 to behave the way 1.6 does?
Thanks for your time.
import javax.swing.*;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeNode;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.util.Enumeration;
public class AutoScroll14 extends JFrame {
    public static void main(String[] args) {
        new AutoScroll14();
    public AutoScroll14() throws HeadlessException {
        super("AutoScroll 1.4");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JTree tree = new JTree();
        tree.setDragEnabled(true);
        tree.setTransferHandler(new MyTransferHandler());
        expand(tree, tree.getPathForRow(0));
        JScrollPane sp = new JScrollPane(tree);
        sp.setPreferredSize(new Dimension(300, 200));
        Container content = getContentPane();
        content.setLayout(new BorderLayout());
        content.add(sp, BorderLayout.CENTER);
        pack();
        setVisible(true);
    private void expand(JTree tree, TreePath path) {
        TreeNode node = (TreeNode) path.getLastPathComponent();
        for (Enumeration e = node.children(); e.hasMoreElements();) {
            TreeNode n = (TreeNode) e.nextElement();
            TreePath newPath = path.pathByAddingChild(n);
            expand(tree, newPath);
        tree.expandPath(path);
    private class MyTransferHandler extends TransferHandler {
        private DataFlavor localStringFlavor;
        private String localStringType = DataFlavor.javaJVMLocalObjectMimeType + ";class=java.lang.String";
        private MyTransferHandler() {
            try {
                localStringFlavor = new DataFlavor(localStringType);
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
        public boolean importData(JComponent comp, Transferable t) {
            if (!canImport(comp, t.getTransferDataFlavors())) {
                return false;
            String data = null;
            try {
                if (hasLocalStringFlavor(t.getTransferDataFlavors())) {
                    data = (String) t.getTransferData(localStringFlavor);
                } else {
                    return false;
            } catch (UnsupportedFlavorException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            String location = null;
            if (comp instanceof JTree) {
                location = ((JTree) comp).getSelectionPath().toString();
            System.out.println("Dropping [" + data + "] on location [" + location + "]");
            return true;
        private boolean hasLocalStringFlavor(DataFlavor[] flavors) {
            if (localStringFlavor == null) {
                return false;
            for (int i = 0; i < flavors.length; i++) {
                if (flavors.equals(localStringFlavor)) {
return true;
return false;
public boolean canImport(JComponent comp, DataFlavor[] flavors) {
return hasLocalStringFlavor(flavors);
protected Transferable createTransferable(JComponent c) {
if (c instanceof JTree) {
String toTransfer = ((JTree) c).getSelectionPath().toString();
System.out.println("Creating transferable [" + toTransfer + "]");
return new StringTransferable(toTransfer);
System.out.println("Could not create transferable");
return null;
public int getSourceActions(JComponent c) {
return COPY_OR_MOVE;
private class StringTransferable implements Transferable {
private String data;
private StringTransferable(String data) {
this.data = data;
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[] { localStringFlavor };
public boolean isDataFlavorSupported(DataFlavor flavor) {
return localStringFlavor.equals(flavor);
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
if (!isDataFlavorSupported(flavor)) {
throw new UnsupportedFlavorException(flavor);
return data;

I added the class "TreeDropTarget".
"TreeDropTarget" extends the class "DropTarget", which implements the interface "DropTargetListener".
DropTargetListener has a few methods, that are called automatically by Swing during drag operation
(dragOver, dragExit, drop). So we can implement "autoscroll", as well as "automatic node expansion".
With "automatic node expansion", a collapsed node will be expanded,
so that its children become visible and we can do a drop on them:
package demo;
* AutoScroll.java
* source level 1.4
import javax.swing.*;
import javax.swing.tree.*;
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.dnd.*;
import java.io.*;
import java.util.*;
public class AutoScroll extends JFrame {
    public static void main(String[] args) {
        new AutoScroll();
    public AutoScroll() throws HeadlessException {
        super("AutoScroll " + System.getProperty("java.version"));
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JTree tree = new JTree();
        tree.setDragEnabled(true);
        tree.setTransferHandler(new MyTransferHandler());
        tree.setDropTarget(new TreeDropTarget());//<----------------------
        expand(tree, tree.getPathForRow(0));
        JScrollPane sp = new JScrollPane(tree);
        sp.setPreferredSize(new Dimension(300, 200));
        Container content = getContentPane();
        content.setLayout(new BorderLayout());
        content.add(sp, BorderLayout.CENTER);
        pack();
        setVisible(true);
    private void expand(JTree tree, TreePath path) {
        TreeNode node = (TreeNode) path.getLastPathComponent();
        for (Enumeration e = node.children(); e.hasMoreElements();) {
            TreeNode n = (TreeNode) e.nextElement();
            TreePath newPath = path.pathByAddingChild(n);
            expand(tree, newPath);
        tree.expandPath(path);
    private class MyTransferHandler extends TransferHandler {
        private DataFlavor localStringFlavor;
        private String localStringType = DataFlavor.javaJVMLocalObjectMimeType + ";class=java.lang.String";
        private AutoScroll.MyTransferHandler.StringTransferable transferable;
        private MyTransferHandler() {
            try {
                localStringFlavor = new DataFlavor(localStringType);
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
        protected void exportDone(JComponent comp, Transferable t, int action) {
            if (t == null) {
                t = transferable;
            if (!canImport(comp, t.getTransferDataFlavors())) {
                return;
            String data = null;
            try {
                if (hasLocalStringFlavor(t.getTransferDataFlavors())) {
                    data = (String) t.getTransferData(localStringFlavor);
                } else {
                    return;
            } catch (UnsupportedFlavorException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            String location = null;
            if (comp instanceof JTree) {
                location = ((JTree) comp).getSelectionPath().toString();
            System.out.println("Dropping [" + data + "] on location [" + location + "]");
            return;
        private boolean hasLocalStringFlavor(DataFlavor[] flavors) {
            if (localStringFlavor == null) {
                return false;
            for (int i = 0; i < flavors.length; i++) {
                if (flavors.equals(localStringFlavor)) {
return true;
return false;
public boolean canImport(JComponent comp, DataFlavor[] flavors) {
return hasLocalStringFlavor(flavors);
protected Transferable createTransferable(JComponent c) {
if (c instanceof JTree) {
String toTransfer = ((JTree) c).getSelectionPath().toString();
System.out.println("Creating transferable [" + toTransfer + "]");
transferable = new StringTransferable(toTransfer);
return transferable;
System.out.println("Could not create transferable");
return null;
public int getSourceActions(JComponent c) {
return COPY_OR_MOVE;
private class StringTransferable implements Transferable {
private String data;
private StringTransferable(String data) {
this.data = data;
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[]{localStringFlavor};
public boolean isDataFlavorSupported(DataFlavor flavor) {
return localStringFlavor.equals(flavor);
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
if (!isDataFlavorSupported(flavor)) {
throw new UnsupportedFlavorException(flavor);
return data;
class TreeDropTarget extends DropTarget {
public TreeDropTarget() {
super();
public void dragOver(DropTargetDragEvent dtde) {
JTree tree = (JTree) dtde.getDropTargetContext().getComponent();
Point loc = dtde.getLocation();
updateDragMark(tree, loc);
autoscroll(tree, loc);
super.dragOver(dtde);
private Insets getAutoscrollInsets() {
return autoscrollInsets;
private void autoscroll(JTree tree, Point cursorLocation) {
Insets insets = getAutoscrollInsets();
Rectangle outer = tree.getVisibleRect();
Rectangle inner = new Rectangle(
outer.x + insets.left,
outer.y + insets.top,
outer.width - (insets.left + insets.right),
outer.height - (insets.top + insets.bottom));
if (!inner.contains(cursorLocation)) {
Rectangle scrollRect = new Rectangle(
cursorLocation.x - insets.left,
cursorLocation.y - insets.top,
insets.left + insets.right,
insets.top + insets.bottom);
tree.scrollRectToVisible(scrollRect);
public void updateDragMark(JTree tree, Point location) {
int row = tree.getRowForPath(tree.getClosestPathForLocation(location.x, location.y));
TreePath path = tree.getPathForRow(row);
if (path != null) {
markNode(tree, location);
private void markNode(JTree tree, Point location) {
TreePath path = tree.getClosestPathForLocation(location.x, location.y);
if (path != null) {
if (lastRowBounds != null) {
Graphics g = tree.getGraphics();
g.setColor(Color.white);
g.drawLine(lastRowBounds.x, lastRowBounds.y,
lastRowBounds.x + lastRowBounds.width, lastRowBounds.y);
tree.setSelectionPath(path);
tree.expandPath(path);
private Rectangle lastRowBounds;
private Insets autoscrollInsets = new Insets(20, 20, 20, 20);

Similar Messages

  • DnD from JTree to JTable

    Hi guys,
    It seems JTree DnD support is a quit difficult feature to implement of all swing components.
    I'm writing an application in which I have a JTree structure representing the file system of user machine and another JTable component at the right.
    I want to be able to drag files nodes from left JTree to right JTable.
    I would appreciate a lot if someone share with me some source code examples for this functionality.
    can someone post some basic java code to get me started or point me to some web resource discussing this feature?
    thanks much.

    http://forum.java.sun.com/thread.jspa?threadID=296255Thank you. I already looked at this thread but it's not what i'm looking for: it shows dnd from a JTree to another JTree..however i need to implement dnd from JTree to JTable.
    Is there some basic example on how to do that ?
    thanks.

  • DND in JTrees

    Is there anyway that we can prevent DND on a specific Node of a JTree?
    Thanks,
    ananth

    Please read my first message in the start of this thread DnD are not always turned off. Meaning if a user selects a red category, the CSF device is set to DnD. If the user sets the category to "Available" the DnD are not removed everytime.
    Any idea?
    Thanks
    Kristian   

  • DnD with JTree

    Hi All,
    I am creating two JTree ojects and registering it for DnD by calling method setDragEnabled(true). I created Class that extends from TransferHandler which contains all the required method including importData(). I have also created class for Transferable. But when i try to perform drag from one tree and drop it on another tree it is not working, but if I do it on the same tree it is working fine which I don't want to do. Here are the code snippets that create tree object and initialization.
    JPanel panel = new JPanel();
    JTree onTree = new JTree(new Vector());
    onTree.setCellRenderer(new MyTreeCellRenderer());
    onTree.setShowsRootHandles(true);
    transferHandler1 = new MyTransferHandler();
    onTree.setTransferHandler(transferHandler1);
    onTree.setDragEnabled(true);
    MyObjectJB myObj = (MyObjectJB) createData();
    AdPlanningTreeNode root = new AdPlanningTreeNode(spot);
    AdPlanningTreeNode spotNode = constructSubTree(root, spot);
    JTree offTree = new JTree(root);
    offTree.setCellRenderer(new DisplayTreeCellRenderer());
    offTree.setShowsRootHandles(true);
    transferHandler2 = new DisplayTransferHandler();
    offTree.setTransferHandler(transferHandler2);
    offTree.setDragEnabled(true);
    AdPlanningJScrollPane offScroller = new AdPlanningJScrollPane(offTree);
    AdPlanningJScrollPane onScroller = new AdPlanningJScrollPane(onTree);
    panel.add(offScroller);
    panel.add(onScroller);Here is code in importData() method of MyTransferHandler.
    public boolean importData(JComponent comp, Transferable t) {
    boolean isImported = false;
    try {
         if (!canImport(comp, t.getTransferDataFlavors())) {
              System.out.println("MyTransferHandler.importData ; can not import");
              return false;
         JTree targetTree = (JTree) comp;
         TreePath parentPath = targetTree.getSelectionPath();
         MyTreeNode parentNode = null;
         DefaultTreeModel model = (DefaultTreeModel) targetTree.getModel();
         MyObject item = (MyObject) DeepCopyUtil.createDeepCopy(t.getTransferData(SUPPORTED_FLAVORS));
         MyTreeNode node = new MyTreeNode((MyObjectJB) item);
         if (parentPath == null) {
              model.setRoot(node);
              targetTree.setSelectionRow(0);
              targetTree.repaint();
         else {
              parentNode = (MyTreeNode) parentPath.getLastPathComponent();
              model.insertNodeInto(node, parentNode, 0);
         isImported = true;
    catch (UnsupportedFlavorException e) {
         e.printStackTrace();
         return false;
    catch (IOException e) {
         e.printStackTrace();
         return false;
    catch (Exception e) {
         e.printStackTrace();
         return false;
    System.out.println("DisplayTransferHandler.importData completed");
    return isImported;
    One important thing is after dragging and importData method calls
    model.setRoot(node), then model is showing change in data but not reflected in Tree.

    Following link may help you understand: http://forums.java.net/jive/thread.jspa?threadID=9196

  • Strange Apple Logo Behavior During Startup

    I've got a 15" Powerbook with 10.3 installed on it that is exhibiting some strange startup behavior.
    When the apple logo appears during startup, it briefly shakes and then becomes pixelated.
    Startup continues after this, and the computer is not exhibiting any other problems.
    However, I'm concerned that it might be a sign of a more serious problem that I need to address sooner rather than later.
    I've scoured the discussion boards, but haven't come up with any other similar reports.
    Any one have any ideas?

    When the apple logo appears during startup, it
    briefly shakes and then becomes pixelated.
    That means that the computor is having a problem with your password... It is having problems recognizing your password, which it finally accepts....
    george

  • MDB (2-phase commit) behavior during abnormal JMS termination

    Hello to everyone!
    I plan to test the following scenario tomorrow (sort of a bug replication in our system).
    Anyway, wanted to know in advance the expected behavior (just in case one of you already know
    or have an experience related to this test). Thank you in advance.
    Scenario:
    I want to test/know the behavior of a 2-phase commit (2PC) MDB when JMS server abnormally exits
    (say the process was killed).
    Test flow:
    start app server --> deploy 2pc-mdb --> send dummy data --> kill jms process --> restart jms process
    1. will the connection be closed properly?
    2. when jms server restarts, will the value of active consumer(count) doubled?
    note: i think after mdb deployment, corresponding destination consumer count is 1.
    the problem that occurred in our system was that the consumer count doubled after server restarted.
    it seem like the previous connection was not closed when the jms server abnormally terminated.
    any inputs will be greatly appreciated.
    thanks and best regards.

    You have to use TxDataSource for container managed tx or if you are using JTA (in
    addition to ofcourse doing 2PC).
    S
    "Dale Olzer" <[email protected]> wrote:
    >
    Using weblogic 6.1 SP 4
    I have a simple container managed Message Driven Bean. Using a destination
    type
    javax.jms.Queue.
    When the onMessage method finishes the Message is still Pending on the
    queue.
    see the ejb-jar.xml below
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <display-name>IvrMessageBean</display-name>
    <ejb-name>IvrMsgBean</ejb-name>
    <ejb-class>com.edocs.ps.ivr.IvrMsgBean</ejb-class>
    <transaction-type>Container</transaction-type>
    <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
    <message-driven-destination>
    <destination-type>javax.jms.Queue</destination-type>
    </message-driven-destination>
    </message-driven>
    </enterprise-beans>
    </ejb-jar>
    I noticed when I set a JDBC TX DataSource to 2 Phase Commit, the JMS
    transaction
    started commitig and nothing was left pending in the Queue.
    Does 2PC have to be set in a DataSource for Container Managed MDB's to
    work?

  • Odd behavior during full screen video chat with Mountain Lion Messages?

    I've recently upgraded to Mountain Lion on two MacBook Pros (from Lion) and have started to use the new Messages app. I've been using iChat for years and found it reliable for the most part.
    However, I've noticed a new behavior that seems like a bug in the new Messages app.
    Steps to reproduce:
    1. Open Messages app
    2. Initiate a non-FaceTime video chat via the Buddy List or the main Messages window video button
    3. Once the video is started, click on the Full Screen button in the window title bar or in the black toolbar at the bottom of the video
    4. After the video has gone full screen, move the mouse cursor
    5. At this point, the video will slide over (like a Mission Control / Exposé space). The video chat is actually STILL running in full screen view as a dedicated space -- you can slide back with the trackpad or the keyboard as per normal Mission Control controls.
    Step 5 is NOT the correct behavior as per OS X 10.7 Lion. Not to mention, the black toolbar is unusable and it's hard to reach the menu bar Full Screen toggle button since moving the cursor even one pixel makes the screen slide over.
    Has anyone experienced this? If yes, is there a solution? How do we bring this to Apple's attention for a future fix?

    I got the machine to reboot but I had to hold down the power button. I found an article on macworld that said to use the command +control+eject buttons to restart but no go. Nothing.
    There really... REALLY ought to be some way to exit full screen in such a case.

  • Macbook unusual behavior during early hours.

    Well for starters I've had my Black Macbook, pretty sure it's 13 inches, for almost 3 years now. In that time I honestly can't recall this ever happening. I've heard it wake itself before, but that was because I still had something plugged into the USB port. Yesterday though it exhibited some unusual behavior though. One in which I don't ever recall encountering before. It had been asleep since around I believe 9am the previous day. However at 3:27am the unusual behavior occurred. While still sleeping, the same noise as when a cd/dvd is being ejected was made. It was somewhat loud I guess since the tv was on low and I didn't have any fan on. But after making the sound, the light indicating sleep no longer blinked instead it just stayed on. The apple in the lid wasn't lit so I don't think it woke up. But that sleep light just stayed lit for at least a minute. I was a bit shocked much to do anything else.
    Well I then opened up the lid and my Mac woke up as usual. At first I thought it might have been doing the weekly update, but when checked it still showed the last time I checked it. Remembering something I read in a different thread on the forums I went and checked console to see if anything unusual happened.
    Sure enough I found a log for around the exact time my Mac exhibited the unusual behavior.
    2009-08-08 07:15:57 -0400
    MobileDevice: AMDeviceNotificationSubscribe: USBMuxListenerCreate: Connection refused
    Message was edited by: reaper058

    Not sure if the entire post shows, but here's the log from console and a snippet from the system log of where I might think the problem started
    Sure enough I found a log for around the exact time my Mac exhibited the unusual behavior.
    Aug 9 03:27:48 Macintosh mDNSResponder: Repeated transitions for interface lo0 (127.0.0.1); delaying packets by 5 seconds
    Aug 9 03:27:59 Macintosh mDNSResponder: NOTE: Wide-Area Service Discovery disabled to avoid crashing defective DNS relay 192.168.1.1.
    System log showed this:
    Aug 9 03:27:31 Macintosh kernel[0]: IOBluetoothHCIController::restartShutdownWL this is a wake from sleep
    Aug 9 03:27:31 Macintosh kernel[0]: System Wake
    Aug 9 03:27:31 Macintosh kernel[0]: IOUSBWorkLoop::closeGate - interrupt Thread being held offUSB caused wake event (EHCI)
    Aug 9 03:27:31 Macintosh kernel[0]: IOBluetoothHCIController::terminateWL .. done
    Aug 9 03:27:31 Macintosh kernel[0]: CSRHIDTransitionDriver::probe:
    Aug 9 03:27:31 Macintosh kernel[0]: CSRHIDTransitionDriver::start before command
    Aug 9 03:27:31 Macintosh kernel[0]: CSRHIDTransitionDriver::stop
    Aug 9 03:27:31 Macintosh kernel[0]: IOBluetoothHCIController::start Idle Timer Stopped
    Aug 9 03:27:32 Macintosh kernel[0]: Registering For 802.11 Events
    Aug 9 03:27:32 Macintosh kernel[0]: [HCIController][setupHardware] AFH Is Supported
    Aug 9 03:27:36 Macintosh kernel[0]: hibernate image path: /var/vm/sleepimage
    Aug 9 03:27:36 Macintosh kernel[0]: sizeof(IOHibernateImageHeader) == 512
    Aug 9 03:27:36 Macintosh kernel[0]: Opened file /var/vm/sleepimage, size 1073741824, partition base 0xc805000, maxio 400000
    Aug 9 03:27:36 Macintosh kernel[0]: hibernate image major 14, minor 2, blocksize 512, pollers 3
    Aug 9 03:27:36 Macintosh kernel[0]: hibernateallocpages flags 00000000, gobbling 0 pages
    Aug 9 03:27:36 Macintosh lookupd[398]: lookupd (version 369.8) starting - Sun Aug 9 03:27:36 2009
    elp would be most appreciated. Thank You

  • Subcon Quota Arrangement behavior during MRP

    Dear Gurus,
    Currently, we have a scenario wherein during subcon process there can be 3 Vendors active. During MRP, we would like to have an output as per below:
    Requirement: 1500
    Vendor A: capacity 500 - priority 1
    Vendor B: capacity 700 - priority 2
    Vencor C: capacity 500 - priority 3
    If I run MRP, I would like system to have PR's Vendor A with 500 then as the Vendors capacity is only 500 the remaining requirement should be passed on the succeding vendors. So from my example, Vendor B should have 700 and Vendor C should have 300.
    Is this possible using Quota Arrangement. I was trying to test but I cannot get my desired result.
    Please note that the settings in the material master is already set to Quota usage 4 and the lotsize is weekly with splitting quota activated.
    Thanks,
    Raymond
    Edited by: Raymond on Oct 10, 2011 11:17 AM

    Hi,
    Yes I have maintained below in MEQ1 just for testing but I cannot get the desired result:
                      Quota Percentage        Maximum Lot size      Priority
    Vendor A:   100                                 500                           1
    Vendor B:    100                                 700                          2
    Vendor C:                                           500                          3
    Set-up Weekly lotsize with splitting quota and quota usage 4.
    But during MRP execution, I think the system splits the requirement quantity into 2 and distribute to Vendor A and Vendor B then if it reached maximum lotsize it proposed to vendor C.
    our requirement is first to consider Vendor A then Vendor B then Vendor C according to maximum lot size and priority.
    Any idea if this is possible?
    Thanks,
    Raymond

  • Undo behavior during instance recovery

    i'm confused about 2 concepts in applying undoin the case of instance failure
    1.the common concepts of instance recovery which states :
    a) when instance crash, oracle automatically applies all redo in the redo file to roll the db forward to the last scn be4 the failure
    b) & redo data also contains the undo data, it also undo the uncommitted changes from the old valuesin the undo.
    that'sok
    2.but refereing to 10g database concepts (ch17 high availability-p317 if pdf)
    url: http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/high_av.htm#sthref2531
    it says:
    •With fast-start fault recovery, the Oracle database is opened for access by applications without having to wait for the undo, or rollback, phase to be completed.
    •The rollback of data locked by uncommitted transaction is done dynamically on an as needed basis.
    •If the user process encounters a row locked by a crashed transaction, then it just rolls back that row.
    •The impact of rolling back the rows requested by a query is negligible.
    •Fast-start fault recovery is very fast, because undo data is stored in the database, not in the log files.
    •Undoing a block does not require an expensive sequential scan of a log file.
    so which situation is applicable in case of instance recovery
    & do the undo behvior stated above in case of fast start fault recovery is an option or that's the default
    thnx alot

    Hi,
    Whatever changes are made to the database, are recorded in redo log buffer cache sequentially and then shifted to redo log files. Suppose redo logs recorded following changes in the database in following sequence.
    insert a row
    update a row
    commit;
    delete a row
    Now Instance crashes before these changes were written into the database (data remains in buffer cache until checkpoint)
    Now during instance recovery, data which was still in buffer cache and not written to the data files, will be applied in same sequence. All undo data for update/delete is in redo log files and will be applied in the same sequence.
    Salman

  • Write-through Cache behavior during Transactional Operation

    If a put is called on a write-through cache during a transaction(with Optimistic Read-Committed settings) that involves multiple caches some set to write-through and others to write-behind, when will the store operation on the corresponding CacheStore be attempted?
         a) Immediately after the put() is called on the cache but before the transaction commit
         or
         b) Immediately after the transaction is committed irrespective of when the put is called

    Hi Abhay,
         The backing map (in this case, <tt>com.tangosol.net.cache.ReadWriteBackingMap</tt>) is responsible for calling the CacheStore implementation. When "commit" is called, Coherence will synchronously send the data to the backing map; the backing map then determines what to do with the data. In the case of ReadWriteBackingMap, it will either (depending on its configuration) synchronously call CacheStore (meaning that a store exception will interrupt your transaction) or queue the update for later (meaning that any store exception will occur after the cache transaction has completed).
         In 3.0, the <rollback-cachestore-failures> element under <read-write-backing-map-scheme> controls whether CacheStore exceptions are propagated back to the client. If you are using a release prior to 3.0, please see this FAQ Item on CacheStore Exceptions.
         Jon Purdy
         Tangosol, Inc.

  • Attatching library behaviors during runtime?

    Well I have a graphic on the screen (not on the score but it's a child object that takes a sprite channel when it's created) but I want it to appear using the "Pixelate" behavior from the library. I want to know if by asigning it to a sprite scriptInstanceList or scriptList (and maybe then running a custom on runPropertyDialog event handler that I would have to create cause it's not present in the original "pixelate" behavior, although I guess that's not big deal doing through a duplicate of the behavior) it could be posible to effectively apply this interesting effect. The other alternative I'm thinking about is copying the parts of the behavior that I want into my scripts and adapt them as needed.

    This is how I have made it to work, finally I think it's necesary to add it to the scriptInstanceList of the same sprite or else (in my testings) won't work. Thanks again! property values can be altered in the new handler but keeping in mind the limits established by the designers for these parameters (check on getPropertyDescriptionList for this).
    - Calling code from outside:
    RIGHT AFTER CREATING THE INSTANCE OF THE GRAPHIC:
           _pixelate= new(script"customPixelate", theGraphicSpNum)
           add(sprite(theGraphicSpNum).scriptInstanceList, _pixelate)
           _movie.call(#beginSprite, _pixelate)
    - Inside a custom version of pixelate:
         property spriteNum
         property appearWhen, pixelateDuration, horizontalPixels, verticalPixels, minimumDim
         on new me, aSpNum -- for implementation via lingo
           spriteNum= aSpNum 
           appearWhen = "beginning of sprite" 
           pixelateDuration = 50
           horizontalPixels = 3
           verticalPixels = 3
           minimumDim = 4
           return me
         end new
    Just for your reference the original behavior is under window/library palette and then animation/sprite transitions/pixelate

  • Strange behavior during authentification to the application

    hello everybody, I place you in the context. I made a web application for the billing department, which is in final phase of the project, to complete it I must resolve the problem of authentication. This application is deployed on tomcat 5.5.23 on Windows XP.
    When I access the application, it authenticates me in a transparent way with JCIFS ntlm authentication on the Windows 2003 domain and posts the page without problem. The bug is when a second user wants to access the application, the logon box appears, then nobody cannot be authenticated except the first user who accessed the application. You see the problematic of my web application.
    With a simplistic application to solve the problem, I noticed that during the authentification, an application is �monopolized� by the user. example: The user A can access the app1. The user B can access the app2. The user A can't access the app2 and vice versa.I think that the problem is in the file Web.xml but I don't know what to configure to solve the problem.
    To finish, the technical part is here, and thanks for your assistance, that will be really appreciated.of authentication.
    web.xml
    <filter>
    <filter-name>NtlmHttpFilter</filter-name>
    <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
    <init-param>
    <param-name>jcifs.http.domainController</param-name>
    <param-value>adserver.mycompany.com</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>NtlmHttpFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>

    Did you try & see if this may help?
    •Intel-based Macs: Resetting the System Management Controller (SMC) - Apple Support
    •Apple Portables: Troubleshooting MagSafe adapters - Apple Support
    That should. If not, a diagnostic test may be necessary to see what else may be involved.
    An Apple Store with Genius or specialist on staff may be of help for testing, also. If not
    see an Apple authorized service provider, an independent authorized/trained agent. These
    would be able to perform several levels of testing, troubleshooting, and provide estimate.
    Good luck & happy computing!

  • Variants in queries behavior during upgrade?

    hi you all ,
    we just upgraded our system from 4.6c to ecc6/.
    and i found out that something is not all right with the query variants.
    the variants are there but it aint show the data as it was in the old system (some columns are missing).
    i read notes and excuted RSAQ_REPAIR_LAYOUT_VARIANTS but no help after all these are queries....
    does any one know what should i do?
    thanks....

    Hi,
    Please check FM RSAQ_GENERATE_PROGRAM.
    Perhaps you may need to write custom program for each record that you want in the query table AQGQCAT. just call the above FM.
    Regards,
    Shimi T

  • Schedule Margin Key behavior during External Procurement and Inhse Prodn

    Hi Gurus
    Could you give me detailed illustration in a visualising manner the Application of Schedule Margin Key in
    "External Procurement for Raw Material" and "Inhouse Production for Production Order" with one scenario
    Stating each and every floats in more detail
    a) Opening Period -applicable for ext and inter
    b)Float before prod-applica only for external

    Hi,
    The complete explaination for your requirment is available in help.sap.com, under MRP-->scheduling section
    Regards,
    Nataraj

Maybe you are looking for