Problems to differentiate between attachments and embedded in an email

In my code i have something like that to verify if the attachment is embedded or not:
public static bool IsEmbeddedAttachment(Outlook.Attachment attachment)
//Anexos que não são embedded são obrigatóriamente olByValue, porém os embedded podem ser de qualquer tipo
if (attachment.Type != Outlook.OlAttachmentType.olByValue)
return true;
//Busca a propriedade contentID do anexo. Anexos embedded não precisam necessáriamente gerar um ContentID. Anexos fixos não geram ContentID
string strATTACH_CONTENT_ID = attachment.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x3712001E").ToString();
//Busca a propriedade contentLocation. Para que o anexo seja embedded é necessario que essa propriedade esteja vazia ou nulla
string strATTACH_CONTENT_LOCATION = attachment.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x3713001E").ToString();
if (!string.IsNullOrWhiteSpace(strATTACH_CONTENT_ID) || !string.IsNullOrWhiteSpace(strATTACH_CONTENT_LOCATION))
//Busca a propriedade AttachFlag se for diferente de 4 é uma imagem embedded
if ((int)attachment.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x37140003") == 4)
return true;
if ((int)attachment.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x37050003") == 6)
return true;
if ((int)attachment.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x37140003") == 4)
return true;
return false;
And was working very well until last week. 
I have a problem with a single email. This email attachments possess 2 PDF type files. These files are not embbed in the email, but they have the contentId property. Could you tell me why? or if its possible discovery why this happens?
PS.: Sorry about my english.

Hi Dmitry,
Thank you again,
Today i have a new issue, An email can have a file of the kind .msg  as attachment. 
when the method is called was made a validation by the Attachment.Type property. But when i have a .msg file this property returns Outlook.OlAttachmentType.olEmbeddeditem. So i changed my code to this:
using Outlook = Microsoft.Office.Interop.Outlook;
public static bool IsEmbeddedAttachment(Outlook.Attachment attachment)
if (!DocumentFormat.IsImageFormat(Path.GetExtension(attachment.FileName)))
return false;
//if is an .msg file is Outlook.OlAttachmentType.olEmbeddeditem
if (attachment.Type != Outlook.OlAttachmentType.olByValue)
return true;
//Busca a propriedade contentID do anexo. Anexos embedded não precisam necessáriamente gerar um ContentID. Anexos fixos não geram ContentID
string strATTACH_CONTENT_ID = attachment.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x3712001E").ToString();
//Busca a propriedade contentLocation. Para que o anexo seja embedded é necessario que essa propriedade esteja vazia ou nulla
string strATTACH_CONTENT_LOCATION = attachment.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x3713001E").ToString();
if (!string.IsNullOrWhiteSpace(strATTACH_CONTENT_ID) || !string.IsNullOrWhiteSpace(strATTACH_CONTENT_LOCATION))
return true;
if ((int)attachment.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x37050003") == 6)
return true;
if ((int)attachment.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x37140003") == 4)
return true;
return false;
but i still have a problem, i cant get the attachments from THIS attachment(the .msg file) and i need to get these attachments. How can i get this attachments?
ps.: Sorry about my english.
att,s
Rissardi

Similar Messages

  • Differentiate between mapping and optimization.

    Hi
    tell me some thing about this.
    Differentiate between mapping and optimization.
    please
    urgent. imran

    user571615 wrote:
    Hi
    tell me some thing about this.
    Differentiate between mapping and optimization.
    please
    urgent. imranThis is a forum of volunteers. There is no urgent here. For urgent, buy yourself a support contract and open an SR on MetaLink.

  • Htmlb:tree differentiate between nodeclick and tree node expander click

    Hi,
    how can i differentiate between nodeclick and tree node expander (to get to its children) click in my event processing in htmlb:tree element.
    <u><b>What i am trying to achieve?</b></u>
    Onload just load root node and its immediate children.
    On node expand get the children of the current node and modify htmlb:tree table2 with additional node inofs.
    on node click  call some client function.
    But my issue is that i am not able to differentiate between node expander click and node click in my event handling. Any help on this is appreciated.
    (I am not using MVC)
    Thanks in advance.
    Regards
    Raja
    Message was edited by: Durairaj Athavan Raja

    After reading your weblog I think I understand better. I did some testing with my example.  I am using the toggle = "true", so that the page returns to the server each time an expander is selected.
    <htmlb:tree id          = "myTree1"
                  height      = "75%"
                  toggle      = "true"
                  title       = "<b><otr>EQI Reporting Tree</otr></b>"
                  width       = "90%"
                  onTreeClick = "myTreeClick"
                  table       = "<%= application->selection_model->itview                             %>" >
      </htmlb:tree>
    However I have not added any coding in my event handler to respond to the expander event.  I only respond to myTreeClick (which loads some data for the given selection).  The BSP tree element itself must be doing the hard work for me. 
      if event_id cs 'tr_myTree1'.
        data: tree_event type ref to cl_htmlb_event_tree.
        tree_event ?= htmlb_event.
        if tree_event->server_event = 'myTreeClick'.
          clear appl->message1.
          appl->selection_model->get_chart_data( appl = appl
                                                 node = tree_event->node ).
        endif.
      endif.
    I pass my entire tree defintion to the element.  It appears that it only sends visible nodes to be rendered. When the expander is selected, I don't have to do anything, the tree re-renders with only the newly visible rows. 
    I tested and turned off the toggle (toggle = "false") and my page took forever to load because it was sending all the nodes to the frontend on the first load.

  • Servlet filter that can differentiate between Filter and Servlet Writers

    Hey,
    I'm trying to build a Filter and HttpServletResponseWrapper that, when applied to a generic servlet, can differentiate between the output stream from the Servlet and the one from the Filters.
    So, say I have a servlet:
    PrintWriter pw = response.Writer();
    pw.write( "Output from servlet" );
    pw.close();And a filter that is applied to the servlet:
    PrintWriter pw = response.Writer();
    pw.write( "Output from filter" );
    pw.close();I want to be able to do this in my filter that is able to differentiate between the servlet and filter response:
    System.out.println( "Response from servlet: " + responseWrapper.servlet.toString() );
    System.out.println( "Response from filter: " + responseWrapper.filter.toString() );The responseWrapper.servlet and responseWrapper.filter can contain all filter responses from all the servlet(s) and filter(s), respectively.
    Can anyone give me guidance as to how to start with this - really I just need to know if I can differentiate between servlet and filter responses in a generic way (without having to modify the response specially in the filter or servlet files that write output)
    Thanks for your time.

    first thing's first..if the OutputStream if not closed Either a Filter or a ServletChain can write on to the stream.
    There could be cases where the servletoutputstream would be closed at servlet end itself.Therefore,its a valiant effort by acomplishing a responseheader in the response to indicate that.
    Now once the response/outputstream is not closed or flushed out there is not direct way by which you do this unless we indicate using response Headers as flags when we are implementing FilterChaning.
    Hope that might help :)
    REGARDS,
    RaHuL

  • Differentiate between Items and Customer Items

    Differentiate between Items and Customer Items
    pls try to give information about this
    thanx

    Hi Joel,
    Funny you mentioned it, because just today I was thinking about that, and I thought that if it will happen, I will rant you on your forum dereliction of duties. So it seems you’re off the hook now :)
    Anyway, judging from the last 3.0/3.0.1 versions it seems like you are doing your other duties very well so I really don’t mind you keeping the lead.
    Best regards,
    Arie.

  • Problems using RMI between linux and windows.

    I have problems using RMI between linux and windows.
    This is my scenario:
    - Server running on linux pc
    - Clients running on linux and windows PCs
    When a linux client disconnect, first time that server try to call a method of this client, a rmi.ConnectException is generated so server can catch it, mark the client as disconnected and won't communicate with it anymore.
    When a windows client (tested on XP and Vista) disconnect, no exceptions are generated (I tryed to catch all the rmi exception), so server cannot know that client is disconnected and hangs trying to communicate with the windows client.
    Any ideas?
    Thanks in advance.
    cambieri

    Thanks for your reply.
    Yes, we are implementing a sort of callback using Publisher (remote Observable) and Subscribers (remote Observer). The pattern and relative code is very well described at this link: http://www2.sys-con.com/ITSG/virtualcd/java/archives/0210/schwell/index.html (look at the notifySubscribers(Object pub, Object code) function).
    Everything works great, the only problem is this: when a Publisher that reside on a Linux server try to notify something to a "dead" Subscriber that reside on a Windows PC it does't receive the usual ConnectException and so tends to hang.
    As a workaround we have solved now starting a new Thread for each update (notification), so only that Thread is blocked (until the timeout i guess) and not the entire "notifySubscribers" function (that contact all the Subscribers).
    Beside this, using the Thread seem to give us better performance.
    Is that missed ConnectException a bug? Or we are just making some mistake?
    We are using java 6 and when both client and server are Linux or Windows the ConnectException always happen and we don't have any problem.
    I hope that now this information are enough.
    Thanks again and greetings.
    O.C.

  • Attachments and history of my emails are not seen by Windows users

    attachments and history of my emails are not seen by Windows users

    Just guessing at what you mean, try this:
    In Mail, while composing a message, go to Mail's menu and click:
    Edit > Attachments > Always send Windows-friendly attachments

  • Is there a problem with ios 5.1 and gmail?  No email has downloaded since 7-18.

    Is there a problem with ios 5.1 and gmail?  No email has downloaded since 7-18.

    No. Try deleting the account and re-adding it.

  • Problem of routing between inside and outside on ASA5505

    I have a ASA5505 with mostly factory default configuration. Its license allows only two vlan interfaces (vlan 1 and vlan 2). The default config has interface vlan 1 as inside (security level 100), and interface vlan 2 as outside (security level 0 and using DHCP).
    I only changed interface vlan 1 to IP 10.10.10.1/24. After I plugged in a few hosts to vlan 1 ports and connect port Ethernet0/0 (default in vlan 2) to a live network, here are a couple of issues I found:
    a) One host I plugged in is a PC, and another host is a WAAS WAE device. Both are in vlan 1 ports. I hard coded their IP to 10.10.10.250 and 10.10.10.101, /24 subnet mask, and gateway of 10.10.10.1. I can ping from the PC to WAE but not from WAE to the PC, although the WAE has 10.10.10.250 in its ARP table. They are in the same vlan and same subnet, how could it be? Here are the ping and WAE ARP table.
    WAE#ping 10.10.10.250
    PING 10.10.10.250 (10.10.10.250) from 10.10.10.101 : 56(84) bytes of data.
    --- 10.10.10.250 ping statistics ---
    5 packets transmitted, 0 packets received, 100% packet loss
    WAE#sh arp
    Protocol Address Flags Hardware Addr Type Interface
    Internet 10.10.10.250 Adj 00:1E:37:84:C9:CE ARPA GigabitEthernet1/0
    Internet 10.10.10.10 Adj 00:14:5E:85:50:01 ARPA GigabitEthernet1/0
    Internet 10.10.10.1 Adj 00:1E:F7:7F:6E:7E ARPA GigabitEthernet1/0
    b) None of the hosts in vlan 1 in 10.10.10.0/24 can ping interface vlan 2 (address in 172.26.18.0/24 obtained via DHCP). But on ASA routing table, it has both 10.10.10.0/24 and 172.26.18.0/24, and also a default route learned via DHCP. Is ASA able to route between vlan 1 and vlan 2? (inside and outside). Any changes I can try?
    Here are ASA routing table and config of vlan 1 and vlan 2 (mostly its default).
    ASA# sh route
    Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
    * - candidate default, U - per-user static route, o - ODR
    P - periodic downloaded static route
    Gateway of last resort is 172.26.18.1 to network 0.0.0.0
    C 172.26.18.0 255.255.255.0 is directly connected, outside
    C 127.1.0.0 255.255.0.0 is directly connected, _internal_loopback
    C 10.10.10.0 255.255.255.0 is directly connected, inside
    d* 0.0.0.0 0.0.0.0 [1/0] via 172.26.18.1, outside
    interface Vlan1
    nameif inside
    security-level 100
    ip address 10.10.10.1 255.255.255.0
    interface Vlan2
    nameif outside
    security-level 0
    ip address dhcp setroute
    interface Ethernet0/0
    switchport access vlan 2
    All other ports are in vlan 1 by default.

    I should have made the config easier to read. So here is what's on the ASA and the problems I have. The ASA only allows two VLAN interfaces configured (default to Int VLAN 1 - nameif inside, and Int VLAN 2 - nameif outside)
    port 0: in VLAN 2 (outside). DHCP configured. VLAN 2 pulled IP in 172.26.18.0/24, default gateway 172.26.18.1
    port 1-7: in VLAN 1 (inside). VLAN 1 IP is 10.10.10.1. I set all devices IP in VLAN 1 to 10.10.10.0/24, default gateway 10.10.10.1
    I have one PC in port 1 and one WAE device in port 2. PC IP set to 10.10.10.250 and WAE set to 10.10.10.101. PC can ping WAE but WAE can't ping PC. Both can ping default gateway.
    If I can't ping from inside interface to outside interface on ASA, how can I verify inside hosts can get to outside addresses and vise versa? I looked at ASA docs, but didn't find out how to set the routing between inside and outside. They are both connected interfaces, should they route between each other already?
    Thanks a lot

  • How to differentiate between Parent and Child in IBASE?

    Hi. I am working on enhancing a BAPI :BAPI_GOODSMVT_CREATE by calling the following function module IBPP_CREATE_IBASE at its exit.
    The BAPI is being called from an SAP ME system and will be passing MATNR and Serial Number of Parent and Child materials to create the IBASE in ECC system. I am confused as to how to differentiate between whether a object is Parent or a Child when the BAPI: BAPI_GOODSMVT_CREATE is called.

    if you have NULL valued fields. If
    you do a compare and one or both are NULL, then the result is always NULL,
    never true or false. Even comparing two fields which are both NULL will
    give NULL as result, not true! Or if you have something like "select
    sum(field) from ..." and one or more are NULL, then the result will be
    NULL. Use always "if field is NULL ..." for NULL checking and for safety
    maybe something like "select sum( IsNull(field,0) ) from ...". Check the
    function ISNULL() in the manual.

  • Differentiate between invoice and clearing document

    the table BSID and BSAD contains the details of both invoice and clearing documents.
    How to differentiate betwee invoice and clearing document.
    i thought that all debit documents are invoices and credits are clearing documents.
    But its not working because there are invoices which are credit and clearing documents which are debit.
    Please let me know if there is any indicator or field which

    Hi,
    No difference between invoice and billing document.
    But If we want to inform the payable to the customer we use the terminalogy invoice.
    Example Credit meomo, debit memo. etc ...
    As there is no difference , both have the same document types.
    thanks
    Kuntla

  • Differentiate between report and generated scheduled report - report list

    How do I differentiate between a (.rpt) report and a (scheduled generated report) from this report (.rpt with data) when I list all the reports on the server.
    I need this information because when I view the scheduled report, I do not need to set the parameters via the crystal viewer.
    Thanks in advance.
    JM

    Ted.
    I am not sure why the scheduled report is saying si_instance=false.
    So I scheduled the sample report - Drilldown and named the scheduled instance as "DrilldownInstance",
    it created two info objects. One has SI_INSTANCE = true and the other has SI_INSTANCE = false!!!!!
    select * from CI_INFOOBJECTS
    where
    SI_PROGID = 'CrystalEnterprise.Report'
    and SI_KIND = 'CrystalReport'
    and si_name LIKE '%DrilldownInstance%'
    I presume it should have only created one object, and set si_instance=true
    Thanks,
    JM
    P.S
    Sorry to be a bother! but this is driving me nuts!
    Edited by: jam mend on Jan 20, 2009 9:07 PM

  • Unable to differentiate between RFC and BAPI

    Hi guys,
        Nowadays I am studying the above concepts:BAPI and RFC.  But I am confused by the two.
    So far I learnt that the two are both techniques used to realize communication between SAP and external
    systems,and frequently via Remote-enabled Function.  
       My confusion is the distinctions between the two. Would you please do me a favor? Tks

    Hi   Alex,
    Just check it out these answers.
    Remote Function Call :
    RFC is an SAP interface protocol. Based on CPI-C, it considerably simplifies the programming of communication processes between systems.
    RFCs enable you to call and execute predefined functions in a remote system - or even in the same system.
    RFCs manage the communication process, parameter transfer and error handling.
    http://help.sap.com/saphelp_47x200/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm.
    BAPI
    BAPI stands for Business API(Application Program Interface).
    A BAPI is remotely enabled function module
    ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access.
    Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects.
    You create business objects and those are then registered in your BOR (Business Object Repository)
    which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA.
    In this case u only specify the business object and its method from external system
    in BAPI there is no direct system call. while RFC are direct system call.
    Some BAPIs provide basic functions and can be used for most SAP business object types.
    These BAPIs should be implemented the same for all business object types.
    Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs.
    Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    another points,
    BAPI is object oriented. It is placed under Business objects as methods.
    RFC is just a Function module or a call.
    RFC: is just a FM that can be called from remote system too(destination defined in transaction SM59).
    BAPI: Business Application Programming Interface
    A BAPI is a method of a business object defined in the Business Object Repository (BOR). For example, in the BOR, you can find a business object called SalesOrder, which conceptually represents a sales order in the system. A business object typically has several methods that can be used to read, create, modify a particular instance of the business object, or list instances of the business object matching certain selection criteria. These methods are BAPIs.
    Technically, a BAPI is implemented using a RFM. But, unlike the non-BAPI RFMs, a BAPI is usually well documented, has nicer parameter names, and is supported by SAP for several SAP software releases. You can browse Business objects and BAPIs in the SAP system using transaction BAPI.
    Thanks
    Eshwar
    *Rewards if useful*

  • Does namcap differentiate between depends and makedepends ?

    In my mesa-r600-git AUR package i have the following dependency lines :
    depends=('libxt' 'libxxf86vm' 'libxdamage' 'xorg-server' 'libxv' 'libffi')
    makedepends=('pkgconfig' 'python2' 'talloc' 'libxml2' 'imake' 'git' 'glproto' 'dri2proto>=2.6' 'llvm>=3.0' 'xorg-server-devel' 'libxvmc' 'libvdpau')
    When i run namcap on the pkg, it reports :
    mesa-r600g-git W: Dependency libffi included but already satisfied
    it is true that python2 and llvm both require libffi to be installed, but these are makedepends, while libffi needs to be present at runtime.
    The man page for namcap doesn't make clear if namcap does make  a difference between depends and makedepends, does somebody know if it DOES ?

    libffi is in your dependency tree...
    |--libxt
    |--libsm
    +--util-linux provides util-linux-ng
    |--udev
    |--glib2
    |--libffi
    but there is nothing wrong with specifying it anyway.  Hence it is just a warning.

  • BDB read performance problem: lock contention between GC and VM threads

    Problem: BDB read performance is really bad when the size of the BDB crosses 20GB. Once the database crosses 20GB or near there, it takes more than one hour to read/delete/add 200K keys.
    After a point, of these 200K keys there are about 15-30K keys that are new and this number eventually should come down and there should not be any new keys after a point.
    Application:
    Transactional Data Store application. Single threaded process, that's trying to read one key's data, delete the data and add new data. The keys are really small (20 bytes) and the data is large (grows from 1KB to 100KB)
    On on machine, I have a total of 3 processes running with each process accessing its own BDB on a separate RAID1+0 drive. So, according to me there should really be no disk i/o wait that's slowing down the reads.
    After a point (past 20GB), There are about 4-5 million keys in my BDB and the data associated with each key could be anywhere between 1KB to 100KB. Eventually every key will have 100KB data associated with it.
    Hardware:
    16 core Intel Xeon, 96GB of RAM, 8 drive, running 2.6.18-194.26.1.0.1.el5 #1 SMP x86_64 x86_64 x86_64 GNU/Linux
    BDB config: BTREE
    bdb version: 4.8.30
    bdb cache size: 4GB
    bdb page size: experimented with 8KB, 64KB.
    3 processes, each process accesses its own BDB on a separate RAIDed(1+0) drive.
    envConfig.setAllowCreate(true);
    envConfig.setTxnNoSync(ourConfig.asynchronous);
    envConfig.setThreaded(true);
    envConfig.setInitializeLocking(true);
    envConfig.setLockDetectMode(LockDetectMode.DEFAULT);
    When writing to BDB: (Asynchrounous transactions)
    TransactionConfig tc = new TransactionConfig();
    tc.setNoSync(true);
    When reading from BDB (Allow reading from Uncommitted pages):
    CursorConfig cc = new CursorConfig();
    cc.setReadUncommitted(true);
    BDB stats: BDB size 49GB
    $ db_stat -m
    3GB 928MB Total cache size
    1 Number of caches
    1 Maximum number of caches
    3GB 928MB Pool individual cache size
    0 Maximum memory-mapped file size
    0 Maximum open file descriptors
    0 Maximum sequential buffer writes
    0 Sleep after writing maximum sequential buffers
    0 Requested pages mapped into the process' address space
    2127M Requested pages found in the cache (97%)
    57M Requested pages not found in the cache (57565917)
    6371509 Pages created in the cache
    57M Pages read into the cache (57565917)
    75M Pages written from the cache to the backing file (75763673)
    60M Clean pages forced from the cache (60775446)
    2661382 Dirty pages forced from the cache
    0 Dirty pages written by trickle-sync thread
    500593 Current total page count
    500593 Current clean page count
    0 Current dirty page count
    524287 Number of hash buckets used for page location
    4096 Assumed page size used
    2248M Total number of times hash chains searched for a page (2248788999)
    9 The longest hash chain searched for a page
    2669M Total number of hash chain entries checked for page (2669310818)
    0 The number of hash bucket locks that required waiting (0%)
    0 The maximum number of times any hash bucket lock was waited for (0%)
    0 The number of region locks that required waiting (0%)
    0 The number of buffers frozen
    0 The number of buffers thawed
    0 The number of frozen buffers freed
    63M The number of page allocations (63937431)
    181M The number of hash buckets examined during allocations (181211477)
    16 The maximum number of hash buckets examined for an allocation
    63M The number of pages examined during allocations (63436828)
    1 The max number of pages examined for an allocation
    0 Threads waited on page I/O
    0 The number of times a sync is interrupted
    Pool File: lastPoints
    8192 Page size
    0 Requested pages mapped into the process' address space
    2127M Requested pages found in the cache (97%)
    57M Requested pages not found in the cache (57565917)
    6371509 Pages created in the cache
    57M Pages read into the cache (57565917)
    75M Pages written from the cache to the backing file (75763673)
    $ db_stat -l
    0x40988 Log magic number
    16 Log version number
    31KB 256B Log record cache size
    0 Log file mode
    10Mb Current log file size
    856M Records entered into the log (856697337)
    941GB 371MB 67KB 112B Log bytes written
    2GB 262MB 998KB 478B Log bytes written since last checkpoint
    31M Total log file I/O writes (31624157)
    31M Total log file I/O writes due to overflow (31527047)
    97136 Total log file flushes
    686 Total log file I/O reads
    96414 Current log file number
    4482953 Current log file offset
    96414 On-disk log file number
    4482862 On-disk log file offset
    1 Maximum commits in a log flush
    1 Minimum commits in a log flush
    160KB Log region size
    195 The number of region locks that required waiting (0%)
    $ db_stat -c
    7 Last allocated locker ID
    0x7fffffff Current maximum unused locker ID
    9 Number of lock modes
    2000 Maximum number of locks possible
    2000 Maximum number of lockers possible
    2000 Maximum number of lock objects possible
    160 Number of lock object partitions
    0 Number of current locks
    1218 Maximum number of locks at any one time
    5 Maximum number of locks in any one bucket
    0 Maximum number of locks stolen by for an empty partition
    0 Maximum number of locks stolen for any one partition
    0 Number of current lockers
    8 Maximum number of lockers at any one time
    0 Number of current lock objects
    1218 Maximum number of lock objects at any one time
    5 Maximum number of lock objects in any one bucket
    0 Maximum number of objects stolen by for an empty partition
    0 Maximum number of objects stolen for any one partition
    400M Total number of locks requested (400062331)
    400M Total number of locks released (400062331)
    0 Total number of locks upgraded
    1 Total number of locks downgraded
    0 Lock requests not available due to conflicts, for which we waited
    0 Lock requests not available due to conflicts, for which we did not wait
    0 Number of deadlocks
    0 Lock timeout value
    0 Number of locks that have timed out
    0 Transaction timeout value
    0 Number of transactions that have timed out
    1MB 544KB The size of the lock region
    0 The number of partition locks that required waiting (0%)
    0 The maximum number of times any partition lock was waited for (0%)
    0 The number of object queue operations that required waiting (0%)
    0 The number of locker allocations that required waiting (0%)
    0 The number of region locks that required waiting (0%)
    5 Maximum hash bucket length
    $ db_stat -CA
    Default locking region information:
    7 Last allocated locker ID
    0x7fffffff Current maximum unused locker ID
    9 Number of lock modes
    2000 Maximum number of locks possible
    2000 Maximum number of lockers possible
    2000 Maximum number of lock objects possible
    160 Number of lock object partitions
    0 Number of current locks
    1218 Maximum number of locks at any one time
    5 Maximum number of locks in any one bucket
    0 Maximum number of locks stolen by for an empty partition
    0 Maximum number of locks stolen for any one partition
    0 Number of current lockers
    8 Maximum number of lockers at any one time
    0 Number of current lock objects
    1218 Maximum number of lock objects at any one time
    5 Maximum number of lock objects in any one bucket
    0 Maximum number of objects stolen by for an empty partition
    0 Maximum number of objects stolen for any one partition
    400M Total number of locks requested (400062331)
    400M Total number of locks released (400062331)
    0 Total number of locks upgraded
    1 Total number of locks downgraded
    0 Lock requests not available due to conflicts, for which we waited
    0 Lock requests not available due to conflicts, for which we did not wait
    0 Number of deadlocks
    0 Lock timeout value
    0 Number of locks that have timed out
    0 Transaction timeout value
    0 Number of transactions that have timed out
    1MB 544KB The size of the lock region
    0 The number of partition locks that required waiting (0%)
    0 The maximum number of times any partition lock was waited for (0%)
    0 The number of object queue operations that required waiting (0%)
    0 The number of locker allocations that required waiting (0%)
    0 The number of region locks that required waiting (0%)
    5 Maximum hash bucket length
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock REGINFO information:
    Lock Region type
    5 Region ID
    __db.005 Region name
    0x2accda678000 Region address
    0x2accda678138 Region primary address
    0 Region maximum allocation
    0 Region allocated
    Region allocations: 6006 allocations, 0 failures, 0 frees, 1 longest
    Allocations by power-of-two sizes:
    1KB 6002
    2KB 0
    4KB 0
    8KB 0
    16KB 1
    32KB 0
    64KB 2
    128KB 0
    256KB 1
    512KB 0
    1024KB 0
    REGION_JOIN_OK Region flags
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock region parameters:
    524317 Lock region region mutex [0/9 0% 5091/47054587432128]
    2053 locker table size
    2053 object table size
    944 obj_off
    226120 locker_off
    0 need_dd
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock conflict matrix:
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Locks grouped by lockers:
    Locker Mode Count Status ----------------- Object ---------------
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Locks grouped by object:
    Locker Mode Count Status ----------------- Object ---------------
    Diagnosis:
    I'm seeing way to much lock contention on the Java Garbage Collector threads and also the VM thread when I strace my java process and I don't understand the behavior.
    We are spending more than 95% of the time trying to acquire locks and I don't know what these locks are. Any info here would help.
    Earlier I thought the overflow pages were the problem as 100KB data size was exceeding all overflow page limits. So, I implemented duplicate keys concept by chunking of my data to fit to overflow page limits.
    Now I don't see any overflow pages in my system but I still see bad bdb read performance.
    $ strace -c -f -p 5642 --->(607 times the lock timed out, errors)
    Process 5642 attached with 45 threads - interrupt to quit
    % time     seconds  usecs/call     calls    errors syscall
    98.19    7.670403        2257      3398       607 futex
     0.84    0.065886           8      8423           pread
     0.69    0.053980        4498        12           fdatasync
     0.22    0.017094           5      3778           pwrite
     0.05    0.004107           5       808           sched_yield
     0.00    0.000120          10        12           read
     0.00    0.000110           9        12           open
     0.00    0.000089           7        12           close
     0.00    0.000025           0      1431           clock_gettime
     0.00    0.000000           0        46           write
     0.00    0.000000           0         1         1 stat
     0.00    0.000000           0        12           lseek
     0.00    0.000000           0        26           mmap
     0.00    0.000000           0        88           mprotect
     0.00    0.000000           0        24           fcntl
    100.00    7.811814                 18083       608 total
    The above stats show that there is too much time spent locking (futex calls) and I don't understand that because
    the application is really single-threaded. I have turned on asynchronous transactions so the writes might be
    flushed asynchronously in the background but spending that much time locking and timing out seems wrong.
    So, there is possibly something I'm not setting or something weird with the way JVM is behaving on my box.
    I grep-ed for futex calls in one of my strace log snippet and I see that there is a VM thread that grabbed the mutex
    maximum number(223) of times and followed by Garbage Collector threads: the following is the lock counts and thread-pids
    within the process:
    These are the 10 GC threads (each thread has grabbed lock on an avg 85 times):
      86 [8538]
      85 [8539]
      91 [8540]
      91 [8541]
      92 [8542]
      87 [8543]
      90 [8544]
      96 [8545]
      87 [8546]
      97 [8547]
      96 [8548]
      91 [8549]
      91 [8550]
      80 [8552]
    VM Periodic Task Thread" prio=10 tid=0x00002aaaf4065000 nid=0x2180 waiting on condition (Main problem??)
     223 [8576] ==> grabbing a lock 223 times -- not sure why this is happening…
    "pool-2-thread-1" prio=10 tid=0x00002aaaf44b7000 nid=0x21c8 runnable [0x0000000042aa8000] -- main worker thread
       34 [8648] (main thread grabs futex only 34 times when compared to all the other threads)
    The load average seems ok; though my system thinks it has very less memory left and that
    I think is because its using up a lot of memory for the file system cache?
    top - 23:52:00 up 6 days, 8:41, 1 user, load average: 3.28, 3.40, 3.44
    Tasks: 229 total, 1 running, 228 sleeping, 0 stopped, 0 zombie
    Cpu(s): 3.2%us, 0.9%sy, 0.0%ni, 87.5%id, 8.3%wa, 0.0%hi, 0.1%si, 0.0%st
    Mem: 98999820k total, 98745988k used, 253832k free, 530372k buffers
    Swap: 18481144k total, 1304k used, 18479840k free, 89854800k cached
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    8424 rchitta 16 0 7053m 6.2g 4.4g S 18.3 6.5 401:01.88 java
    8422 rchitta 15 0 7011m 6.1g 4.4g S 14.6 6.5 528:06.92 java
    8423 rchitta 15 0 6989m 6.1g 4.4g S 5.7 6.5 615:28.21 java
    $ java -version
    java version "1.6.0_21"
    Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode)
    Maybe I should make my application a Concurrent Data Store app as there is really only one thread doing the writes and reads. But I would like
    to understand why my process is spending so much time in locking.
    Can I try any other options? How do I prevent such heavy locking from happening? Has anyone seen this kind of behavior? Maybe this is
    all normal. I'm pretty new to using BDB.
    If there is a way to disable locking that would also work as there is only one thread that's really doing all the job.
    Should I disable the file system cache? One thing is that my application does not utilize cache very well as once I visit a key, I don't visit that
    key again for a very long time so its very possible that the key has to be read again from the disk.
    It is possible that I'm thinking this completely wrong and focussing too much on locking behavior and the problem is else where.
    Any thoughts/suggestions etc are welcome. Your help on this is much appreciated.
    Thanks,
    Rama

    Hi,
    Looks like you're using BDB, not BDB JE, and this is the BDB JE forum. Could you please repost here?:
    Berkeley DB
    Thanks,
    mark

Maybe you are looking for

  • ABAP routine in infopackage that runs function in ECC

    Hi All I need to have dynamic filter in the info package I have program in ECC that brings me the value that I need to filter in my info packege I want to use  ABAP routine in infopackage that runs function in ECC and brings the value that was receiv

  • Problem with entering integer numbers from keyboard

    I have written this simple code: import java.io.*; public class Simple{      public static void main(String[] args)throws Exception{           System.out.println("Enter two integer numbers: ");           BufferedReader enter=new BufferedReader(new In

  • TS1381 t, y, u, i and o keys stopped working..

    However they work at random times.. Studdenly they work then get stuck again and refuse to work.. is it a hardware issue?

  • Mac mini dilemma! Dont know which to buy..

    I was wondering what you guys think, i am thinking of getting a mac mini to use as a "media center" sorta pc because their small quite and the software seems to be alot more stable then vista. I saw one on amazon for $450 that has a 1.66 core duo pro

  • Help cant boot system kt6delta

    Always the same cant leave things alone! why i dont know. I changed some advanced chipset features now i can not boot system and get back into the bios it goes as far as the logo screen  you can press the tab into the option screen but when you press