简体   繁体   中英

EJB 3 transaction propagation and UnboundId LDAP SDK

Currently I work with EBJ 3 and have to make bean, that have to perform big business operation, that consist of persisting data to DB, sending some JMS messages and persisting some other data to LDAP. I have to make this operation ACID, so this is not any problem about persisting data to DB or sending messages to JMS (all this operation supports transaction propagation). But currently I stuck on persisting data to LDAP. Is there any technique that can solve my problem? We use UnboundId LDAP SDK, that supports LDAP transactins , but I assume, that I can not propagate this transaction to my bean. So, what is the best solution in this case? Should I write some JTA or JTS code? Or there is some simple solution? Or is it even possible to solve this problem - may be I need 2PC ability in LDAP transaction?

The standard LDAP transaction facility as described in RFC 5805 doesn't provide any way to incorporate outside events as part of your transaction (and there are also not very many directory servers that support LDAP transactions -- I know that the UnboundID Directory Server does, and the in-memory server provided as part of the UnboundID LDAP SDK, but I'm not aware of any others that do).

If you need the ability to commit to an LDAP directory server and one or more other kinds of repositories in an atomic manner, then there is no standard LDAP solution that can accommodate that, so you will need a proprietary solution, and it would probably require you to write your own code that would run inside the LDAP server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM