Q & A. XIV

Hi,
I need to link multiple documents to folder in documentum.
those documents are checked out. Can you please advise how can i achieve this?

Thanks
Ram

Unfortunately, this guy didn’t provide a good description for his problem, so, let’s pretend that he is trying to do something like:

update dm_document objects
link '/target/folder'
where ...

and getting something like:

API> ?,c,update dm_document objects link '/Temp' where r_object_id='09024be98006ab34'
[DM_QUERY_F_UP_SAVE]fatal:  "UPDATE:  An error has occurred during a save operation."

[DM_SYSOBJECT_E_LOCKED]error:  
  "The operation on  sysobject was unsuccessful because it is locked by user DCTM_DEV."


API> get,c,09024be98006ab34,r_lock_owner
...
DCTM_DEV

Now follow my hands – it is a magic:

API> ?,c,alter group dm_escalated_allow_save_on_lock  add dmadmin

API> ?,c,update dm_document objects link '/Temp' where r_object_id='09024be98006ab34'
objects_updated
---------------
              1
(1 row affected)
[DM_QUERY_I_NUM_UPDATE]info:  "1 objects were affected by your UPDATE statement."


API> revert,c,09024be98006ab34
...
OK
API> get,c,09024be98006ab34,r_lock_owner
...
DCTM_DEV

Q & A. XIII

Q:

Is there any way to directly run a Java server method on a specific Docbase service instance (in HA setup)?

I have a workaround with a job set up to run on designated target server, however I want to execute a method instantly via the “EXECUTE do_method…” call for example, instead of relying on the agent exec scheduler.

Thanks.

A:

The answer depends on what you are really want to achieve, let’s explain. When you are executing docbase method (next discourse is about Java methods only) there are at least three participants:

  1. Content server which sends http request to JMS and waits for response – your current session
  2. JMS instance that executes you docbase method – in normal situation content server always prefers “embedded” JMS instance
  3. Content serves JMS instance connects to – it depends on how your docbase method is written (for example in case of workflow and job methods content server provides -docbase_name argument using <docbase>.<server> form, so it binds JMS instances to specific content server

As regards to your problem…

If you want to stay within “EXECUTE do_method…” the answer is: “No, you can’t influence on how content server selects JMS instance, if you want to execute docbase method on specific JMS you need to connect to corresponding content server”.

However, if your objectives are something like “We need to execute com.documentum.fc.methodserver.IDfMethod on specific JMS instance”, the answer is “Yes, it is possible:

API> retrieve,c,dm_server_config
...
3d024be980000102
API> dump,c,l
...  


  app_server_name [0]: do_method
                  [1]: do_mail
                  [2]: do_bpm
                  [3]: heavy_proc <- this one runs the show
  app_server_uri  [0]: http://localhost:9080/DmMethods/servlet/DoMethod
                  [1]: http://localhost:9080/DmMail/servlet/DoMail
                  [2]: http://localhost:9080/bpm/servlet/DoMethod
                  [3]: http://localhost:8888/


~]$ nc -l 8888
... waiting ...

API> apply,c,,HTTP_POST,
      APP_SERVER_NAME,S,heavy_proc,
      ARGUMENTS,S,'
        -method_verb MyMethodClass 
        -__dm_docbase__ DCTM_DEV 
        -__dm_server_config__ DCTM_DEV 
        -docbase_name DCTM_DEV.DCTM_DEV 
        -user_name dmadmin 
      ',TRACE_LAUNCH,B,T
...
q0

~]$ nc -l 8888
POST / HTTP/1.1
User-Agent: Documentum Server 7.2.0030.0195  Linux64.Oracle (HTTP Client)
Host: localhost:8888
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 567

__signature_params__=method_verb.....

Q & A. XII

Yesterday I was asked a weird question, and answer for that question deservers an individual blogpost 🙂

Q:

Hi,

I always try to follow up your posts and most of the times it just leaves me confused because some of the conclusions drawn here are contradictory from what EMC guides say. I was currently looking into an issue where the application throws “No more available sessions” error. One of the approach that I was thinking of suggesting was using session manager to release session instead of session.disconnect that we have seen caused some issues in the past for one of our applications. Can you throw some light on this?

Further, from what I see above – Is this always the recommended approach of getting session?
IDfSessionManager sMgr = client.newSessionManager();
Session = sMgr.getSession();

Do we have any particular scenario where private session is used using “IDfSessionManager.newSession()”?
A video from EMC architect that uses this code – https://www.youtube.com/watch?v=YjcxOfiiCNM

A:

This blogpost is not about “how to do Documentum routines”, it is about challenges which I have faced with and how I have managed those challenges, if you think that my opinion is inconsistent with EMC’s documentation/guides/white papers/etc you are always free to take advantage of your support contract and ask EMC why their documentation is a piece of shit, but don’t ask me about that – when I writing a blogpost I always trying to provide some code snippet to prove my opinion.

Feedback storm

On last week I received a dozen of requests related to the one of recent blogposts, and all those requests contain the same two questions:

  • Why is it password protected?
  • When will it be publicly available?

The short story is: after installing latest Content Server patches I had faced with severe compatibility issues and further research revealed that those compatibility issues are caused by “security enhancements” which do not really look like security fixes, for example, I had spent about 6 hours to find out why my application has started failing when running on latest patchset and how to disable new weird behaviour, and just 30 minutes to write a new proof of concept which bypasses new “security enhancements”. After that I performed a deep analysis of last ten security vulnerabilities, which were announced by EMC as remediated and found the same problem: nothing was fixed, moreover some of them contain so rude mistakes that those mistakes look more like backdoors rather than mistakes. At current state I’m trying to bring together all information I have and this blogpost will be publicly available soon.

Q & A. XI

Hopefully, not too boring – if it is, please just reply “sorry, too boring” so I don’t get my hopes up.

I stumbled across this post, which leads me to believe you may have more insights to sessions management than most – Session management. Misconceptions

I was a bit disturbed by you comment about the white-paper – I was so excited when I found it, now you say it’s filled with misconceptions – yikes!

I have a Web ‘application’ that serves as a public site – no logins at all. When I first took over this site our Content Server was crashing constantly, running out of memory. Why…because the public application was creating a new session for each and every user of the site. The same content sever also supports a non-public login-based site, meaning every user has their own Documentum login. This application historically used a lot of CS memory for each session on the CS (not a 1-to-1 I know).

We started having an issue (out of nowhere) this week which severely impacted the public application. For the past 5-6 years this application has run supporting up-to 300-concurrent user off of ~2 client DFC sessions. We are able to do this because the majority of our requests are NOT served by DCTM, instead we use a full-text index (not Xplore). We finally had to take the entire site offline to try to figure out what the heck was going on.

A few pieces of info led us to believe that the issues were related to a slow storage unit backing one of our Filestores. With no traffic flowing to the app, one person tried to download a content file…while waiting for about 1-minute, another user hit another page that runs 3 simple DQL queries. From the application side of things, we saw no response on the page with the queries, UNTIL the content download had returned. This sure appears to be a threading/contention issue…

We have run a few test since, but haven’t yet nailed down anything. I can tell you that we use @Singleton to mark our application’s single session manager. That session manager provides a session via getSession() to each class that asks for one – regardless of http session or request. In my attempt to bandaid the issue, I switched the session request for the slow operating file download to newSession(). Not only did this seem to prevent other requests from waiting on the slow download, it also resulted in lightening fast downloads suddenly. I was concerned that this might cause too many sessions, as some people scrape our site for the content downloads – however so far we’ve only got up-to 15 sessions on the Content Servers from the ‘public’ user.

I am not super experienced with threading, but a quick play around in the code, adding a thread sleep after a getSession() is called, then opening a new browser tab and asking for another page did not show any waiting. This makes me think it’s something within the Session itself that has a threading issue?

Thanks for any thoughts you can share!

As regards your feelings: in my universe (not EMC’s) white-papers are not intended to fill documentation gaps, white-paper may be a good starting point for working with product/technology, but nothing else, and white-papers typically have information about authors (this gives reader a clue about author’s competence, EMC’s white-papers do not have such information, so I consider all EMC’s white-papers as a piece of shit just because some of them are wrong and misleading), product versions, purpose and target audience. But EMC instead of improving their documentation tries to fill documentation gaps by white-papers, the problem is white-papers are not documents and they do not provide a contract about product behaviour (documentation does).

As regards your problem…

When I first took over this site our Content Server was crashing constantly, running out of memory. Why…because the public application was creating a new session for each and every user of the site.

I believe you are talking about some ancient 32-bit content server builds for MS Windows. Indeed, there was such problem because on the one hand MS Windows has a limits on concurrent TCP connections, but these limits are far beyond the practical sense, on the other hand on MS Windows Content Server services client connections using threads within a single process, so the amount of concurrent session Content Server can create is also limited by amount of memory single process can consume – for 32-bit builds this limit is about 2Gb (I’m not a MS Windows expert, so, real values may differ, but the main idea is correct). Also, there is an interesting fact for UNIX builds. On UNIX Content Server services client connections using separate processes, so technically the amount of concurrent client connections is limited by amount of memory presented on CS host, but even in this case EMC put dumb limits on amount of concurrent sessions.

With no traffic flowing to the app, one person tried to download a content file…while waiting for about 1-minute, another user hit another page that runs 3 simple DQL queries. From the application side of things, we saw no response on the page with the queries, UNTIL the content download had returned. This sure appears to be a threading/contention issue…

I do think that either your diagnosis is wrong or you do not provide enough information or you have missed something (actually, taking a thread dump will provide you more clues than just analysing code). Let me explain. You have a hypothesis that “when we share DFC session among threads and and one thread performs transfer of content other threads are unable to execute DQL queries”, relying on the input data you have provided I can say without a doubt that this hypothesis is clearly untenable, the justification of my statement is: DFC performs content transfer from Content Server using 64K chunks, in order to request a chunk DFC sends RPC to content server, when DFC executes DQL queries it also sends RPCs to content server, RPC calls are serialised (you can’t send multiple RPC calls simultaneously) – there is a contention between threads but behaviour differs from yours. Below is a proof of concept – I have created a document of 1Gb worth and try to download it and perform some queries simultaneously, my expectation is if “synchronised” keyword in java provided fair scheduling my code would able to perform about 1024*1024/64/2=8192 (1024*1024/64 – is a number of RPCs required to transfer content, 2 – is a number of RPCs required to execute query) “simultaneous” queries:

public static void main(String[] args) throws Exception {
	final IDfClient client = new DfClientX().getLocalClient();
	client.getClientConfig().setString(DfPreferences.DFC_DOCBROKER_HOST, "192.168.0.253");
	final IDfSession session = client.newSession("DCTM_DEV", new DfLoginInfo("dmadmin", "dmadmin"));
	IDfSysObject sysObject = (IDfSysObject) session.getObject(DfId.valueOf("08024be980023d9d"));
	Thread t1 = new Thread(new Runnable() {
		public void run() {
			try {
				((IDfSysObject) session.getObject(DfId.valueOf("08024be980023d9d"))).getFile(null);
			} catch (DfException ex) {
				throw new RuntimeException(ex);
			}
		}
	});
	Thread t2 = new Thread(new Runnable() {
		public void run() {
			int count = 0;
			try {
				while (!Thread.currentThread().isInterrupted()) {
					IDfQuery q = new DfQuery("select count(*) from dm_server_config");
					q.execute(session, IDfQuery.DF_EXEC_QUERY).close();
					count++;
				}
			} catch (Exception ex) {
				// ignore
			}
			System.out.println(count);
		}
	});
	t1.start();
	t2.start();
	t1.join();
	t2.interrupt();
}

actual result is about 9000-10000 queries and corresponding thread dumps are:

"Thread-9" prio=5 tid=0x00007ff3739b6800 nid=0x5b07 waiting for monitor entry [0x000070000185e000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection$IteratorSynchronizer.getType(DocbaseConnection.java:1971)
	- waiting to lock <0x0000000703009670> (a com.documentum.fc.client.impl.connection.docbase.DocbaseConnection)
	at com.documentum.fc.client.impl.collection.TypedDataCollection.getTypedData(TypedDataCollection.java:39)
	at com.documentum.fc.client.impl.collection.TypedDataCollection.<init>(TypedDataCollection.java:46)
	at com.documentum.fc.client.impl.collection.TypedDataCollection.newInstance(TypedDataCollection.java:31)
	at com.documentum.fc.client.DfQuery.runQuery(DfQuery.java:167)
	at com.documentum.fc.client.DfQuery.execute(DfQuery.java:216)
	at QAXI$2.run(QAXI.java:50)
	at java.lang.Thread.run(Thread.java:745)

"Thread-8" prio=5 tid=0x00007ff3738ae800 nid=0x360b runnable [0x000070000175a000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:152)
	at java.net.SocketInputStream.read(SocketInputStream.java:122)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
	at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:554)
	at sun.security.ssl.InputRecord.read(InputRecord.java:509)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934)
	- locked <0x0000000703141a80> (a java.lang.Object)
	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:891)
	at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
	- locked <0x000000070322d4c0> (a sun.security.ssl.AppInputStream)
	at com.documentum.fc.impl.util.io.MessageChannel.readSocket(MessageChannel.java:129)
	at com.documentum.fc.impl.util.io.MessageChannel.readLength(MessageChannel.java:100)
	at com.documentum.fc.impl.util.io.MessageChannel.getIncomingMessageLength(MessageChannel.java:92)
	at com.documentum.fc.impl.util.io.MessageChannel.read(MessageChannel.java:77)
	- locked <0x00000007031b50f0> (a com.documentum.fc.impl.util.io.MessageChannel)
	at com.documentum.fc.client.impl.connection.netwise.AbstractNetwiseRpcClient.receiveMessage(AbstractNetwiseRpcClient.java:183)
	at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.getBlock(NetwiseDocbaseRpcClient.java:1023)
	- locked <0x00000007031b5068> (a com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient)
	at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.getBlock(DocbaseConnection.java:1473)
	- locked <0x0000000703009670> (a com.documentum.fc.client.impl.connection.docbase.DocbaseConnection)
	at com.documentum.fc.client.impl.connection.docbase.RawPuller.getBlock(RawPuller.java:52)
	- locked <0x0000000703009670> (a com.documentum.fc.client.impl.connection.docbase.DocbaseConnection)
	at com.documentum.fc.client.content.impl.BlockPuller.nextBlock(BlockPuller.java:49)
	at com.documentum.fc.client.content.impl.PullerInputStream.getNextBuffer(PullerInputStream.java:73)
	at com.documentum.fc.client.content.impl.PullerInputStream.ensureBufferHasData(PullerInputStream.java:63)
	at com.documentum.fc.client.content.impl.PullerInputStream.read(PullerInputStream.java:88)
	at java.io.FilterInputStream.read(FilterInputStream.java:133)
	at java.io.FilterInputStream.read(FilterInputStream.java:133)
	at java.io.FilterInputStream.read(FilterInputStream.java:133)
	at java.io.FilterInputStream.read(FilterInputStream.java:107)
	at com.documentum.fc.impl.util.io.StreamUtility.copyContents(StreamUtility.java:50)
	at com.documentum.fc.impl.util.io.StreamUtility.copyContents(StreamUtility.java:30)
	at com.documentum.fc.client.content.impl.LocalContentFile.<init>(LocalContentFile.java:38)
	at com.documentum.fc.client.content.impl.LocalContentManager$LocalContentDirectory.createFile(LocalContentManager.java:480)
	at com.documentum.fc.client.content.impl.LocalContentManager$SessionLocalContentManager.createLocalContentFile(LocalContentManager.java:363)
	- locked <0x00000007cd220198> (a com.documentum.fc.client.content.impl.LocalContentManager$SessionLocalContentManager)
	at com.documentum.fc.client.content.impl.LocalContentManager.createContentFile(LocalContentManager.java:148)
	at com.documentum.fc.client.content.impl.ContentManager.namelessGetFile(ContentManager.java:253)
	at com.documentum.fc.client.content.impl.ContentManager.getFile(ContentManager.java:198)
	at com.documentum.fc.client.content.impl.ContentManager.getFile(ContentManager.java:173)
	at com.documentum.fc.client.DfSysObject.getFileEx2(DfSysObject.java:1972)
	- locked <0x000000070310dfe0> (a com.documentum.fc.client.DfSysObject)
	at com.documentum.fc.client.DfSysObject.getFileEx(DfSysObject.java:1964)
	at com.documentum.fc.client.DfSysObject.getFile(DfSysObject.java:1959)
	at com.documentum.fc.client.DfSysObject___PROXY.getFile(DfSysObject___PROXY.java)
	at QAXI$1.run(QAXI.java:38)
	at java.lang.Thread.run(Thread.java:745)

or:

"Thread-9" prio=5 tid=0x00007fc9f322f000 nid=0x5b0f runnable [0x000070000185e000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:152)
	at java.net.SocketInputStream.read(SocketInputStream.java:122)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
	at sun.security.ssl.InputRecord.read(InputRecord.java:480)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934)
	- locked <0x00000007b2bb45b0> (a java.lang.Object)
	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:891)
	at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
	- locked <0x00000007b2bb4660> (a sun.security.ssl.AppInputStream)
	at com.documentum.fc.impl.util.io.MessageChannel.readSocket(MessageChannel.java:129)
	at com.documentum.fc.impl.util.io.MessageChannel.readLength(MessageChannel.java:100)
	at com.documentum.fc.impl.util.io.MessageChannel.getIncomingMessageLength(MessageChannel.java:92)
	at com.documentum.fc.impl.util.io.MessageChannel.read(MessageChannel.java:77)
	- locked <0x00000007b2bb4690> (a com.documentum.fc.impl.util.io.MessageChannel)
	at com.documentum.fc.client.impl.connection.netwise.AbstractNetwiseRpcClient.receiveMessage(AbstractNetwiseRpcClient.java:183)
	at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.closeCollection(NetwiseDocbaseRpcClient.java:934)
	- locked <0x00000007b2bb4710> (a com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient)
	at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient$TypedDataIterator.close(NetwiseDocbaseRpcClient.java:1366)
	at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection$IteratorSynchronizer.close(DocbaseConnection.java:1963)
	- locked <0x00000007b2bb4790> (a com.documentum.fc.client.impl.connection.docbase.DocbaseConnection)
	at com.documentum.fc.client.impl.collection.TypedDataCollection.close(TypedDataCollection.java:54)
	- locked <0x00000007b10120d0> (a com.documentum.fc.client.impl.collection.TypedDataCollection)
	at com.documentum.fc.client.impl.collection.CollectionHandle.close(CollectionHandle.java:42)
	at QAXI$2.run(QAXI.java:50)
	at java.lang.Thread.run(Thread.java:745)

"Thread-8" prio=5 tid=0x00007fc9f322e000 nid=0x320b waiting for monitor entry [0x000070000175a000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.documentum.fc.client.impl.connection.docbase.RawPuller.getBlock(RawPuller.java:52)
	- waiting to lock <0x00000007b2bb4790> (a com.documentum.fc.client.impl.connection.docbase.DocbaseConnection)
	at com.documentum.fc.client.content.impl.BlockPuller.nextBlock(BlockPuller.java:49)
	at com.documentum.fc.client.content.impl.PullerInputStream.getNextBuffer(PullerInputStream.java:73)
	at com.documentum.fc.client.content.impl.PullerInputStream.ensureBufferHasData(PullerInputStream.java:63)
	at com.documentum.fc.client.content.impl.PullerInputStream.read(PullerInputStream.java:88)
	at java.io.FilterInputStream.read(FilterInputStream.java:133)
	at java.io.FilterInputStream.read(FilterInputStream.java:133)
	at java.io.FilterInputStream.read(FilterInputStream.java:133)
	at java.io.FilterInputStream.read(FilterInputStream.java:107)
	at com.documentum.fc.impl.util.io.StreamUtility.copyContents(StreamUtility.java:50)
	at com.documentum.fc.impl.util.io.StreamUtility.copyContents(StreamUtility.java:30)
	at com.documentum.fc.client.content.impl.LocalContentFile.<init>(LocalContentFile.java:38)
	at com.documentum.fc.client.content.impl.LocalContentManager$LocalContentDirectory.createFile(LocalContentManager.java:480)
	at com.documentum.fc.client.content.impl.LocalContentManager$SessionLocalContentManager.createLocalContentFile(LocalContentManager.java:363)
	- locked <0x00000007abec1350> (a com.documentum.fc.client.content.impl.LocalContentManager$SessionLocalContentManager)
	at com.documentum.fc.client.content.impl.LocalContentManager.createContentFile(LocalContentManager.java:148)
	at com.documentum.fc.client.content.impl.ContentManager.namelessGetFile(ContentManager.java:253)
	at com.documentum.fc.client.content.impl.ContentManager.getFile(ContentManager.java:198)
	at com.documentum.fc.client.content.impl.ContentManager.getFile(ContentManager.java:173)
	at com.documentum.fc.client.DfSysObject.getFileEx2(DfSysObject.java:1972)
	- locked <0x00000007b2b8e5b8> (a com.documentum.fc.client.DfSysObject)
	at com.documentum.fc.client.DfSysObject.getFileEx(DfSysObject.java:1964)
	at com.documentum.fc.client.DfSysObject.getFile(DfSysObject.java:1959)
	at com.documentum.fc.client.DfSysObject___PROXY.getFile(DfSysObject___PROXY.java)
	at QAXI$1.run(QAXI.java:38)
	at java.lang.Thread.run(Thread.java:745)

Note, if I introduce transactions in my PoC I will get a behaviour you have described (I do not want to say that using transactions is a clue for your problem, just start your troubleshooting with taking thread dump):

public static void main(String[] args) throws Exception {
	final IDfClient client = new DfClientX().getLocalClient();
	client.getClientConfig().setString(DfPreferences.DFC_DOCBROKER_HOST, "192.168.0.253");
	final IDfSession session = client.newSession("DCTM_DEV", new DfLoginInfo("dmadmin", "dmadmin"));
	IDfSysObject sysObject = (IDfSysObject) session.getObject(DfId.valueOf("08024be980023d9d"));
	Thread t1 = new Thread(new Runnable() {
		public void run() {
			try {
				session.beginTrans();
				((IDfSysObject) session.getObject(DfId.valueOf("08024be980023d9d"))).getFile(null);
			} catch (DfException ex) {
				throw new RuntimeException(ex);
			} finally {
				try {
					session.abortTrans();
				} catch (DfException ex) {
					// ignore
				}
			}
		}
	});
	Thread t2 = new Thread(new Runnable() {
		public void run() {
			int count = 0;
			try {
				while (!Thread.currentThread().isInterrupted()) {
					IDfQuery q = new DfQuery("select count(*) from dm_server_config");
					q.execute(session, IDfQuery.DF_EXEC_QUERY).close();
					count++;
				}
			} catch (Exception ex) {
				// ignore
			}
			System.out.println(count);
		}
	});
	t1.start();
	t2.start();
	t1.join();
	t2.interrupt();
}

result is 2-3 (actually should be 1 but writing a full PoC is bit boring) “simultaneous” queries and thread dump looks like:

"Thread-9" prio=5 tid=0x00007fb0c2a91800 nid=0x5d07 in Object.wait() [0x000070000185e000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000007bae39970> (a com.documentum.fc.client.impl.connection.docbase.DocbaseConnection)
	at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.waitForCorrectSharingContext(DocbaseConnection.java:820)
	- locked <0x00000007bae39970> (a com.documentum.fc.client.impl.connection.docbase.DocbaseConnection)
	at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.evaluateRpc(DocbaseConnection.java:1108)
	- locked <0x00000007bae39970> (a com.documentum.fc.client.impl.connection.docbase.DocbaseConnection)
	at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.applyForCollection(DocbaseConnection.java:1265)
	at com.documentum.fc.client.impl.docbase.DocbaseApi.exec(DocbaseApi.java:83)
	at com.documentum.fc.client.impl.session.Session.query(Session.java:3630)
	at com.documentum.fc.client.impl.session.SessionHandle.query(SessionHandle.java:2322)
	at com.documentum.fc.client.DfQuery.runQuery(DfQuery.java:167)
	at com.documentum.fc.client.DfQuery.execute(DfQuery.java:216)
	at QAXI$2.run(QAXI.java:57)
	at java.lang.Thread.run(Thread.java:745)

"Thread-8" prio=5 tid=0x00007fb0c3887800 nid=0x1307 runnable [0x000070000175a000]
   java.lang.Thread.State: RUNNABLE
	at java.io.FileOutputStream.writeBytes(Native Method)
	at java.io.FileOutputStream.write(FileOutputStream.java:345)
	at com.documentum.fc.impl.util.io.StreamUtility.copyContents(StreamUtility.java:51)
	at com.documentum.fc.impl.util.io.StreamUtility.copyContents(StreamUtility.java:30)
	at com.documentum.fc.client.content.impl.LocalContentFile.<init>(LocalContentFile.java:38)
	at com.documentum.fc.client.content.impl.LocalContentManager$LocalContentDirectory.createFile(LocalContentManager.java:480)
	at com.documentum.fc.client.content.impl.LocalContentManager$SessionLocalContentManager.createLocalContentFile(LocalContentManager.java:363)
	- locked <0x00000007bae93480> (a com.documentum.fc.client.content.impl.LocalContentManager$SessionLocalContentManager)
	at com.documentum.fc.client.content.impl.LocalContentManager.createContentFile(LocalContentManager.java:148)
	at com.documentum.fc.client.content.impl.ContentManager.namelessGetFile(ContentManager.java:253)
	at com.documentum.fc.client.content.impl.ContentManager.getFile(ContentManager.java:198)
	at com.documentum.fc.client.content.impl.ContentManager.getFile(ContentManager.java:173)
	at com.documentum.fc.client.DfSysObject.getFileEx2(DfSysObject.java:1972)
	- locked <0x00000007bb011c60> (a com.documentum.fc.client.DfSysObject)
	at com.documentum.fc.client.DfSysObject.getFileEx(DfSysObject.java:1964)
	at com.documentum.fc.client.DfSysObject.getFile(DfSysObject.java:1959)
	at com.documentum.fc.client.DfSysObject___PROXY.getFile(DfSysObject___PROXY.java)
	at QAXI$1.run(QAXI.java:39)
	at java.lang.Thread.run(Thread.java:745)

I can tell you that we use @Singleton to mark our application’s single session manager. That session manager provides a session via getSession() to each class that asks for one – regardless of http session or request. In my attempt to bandaid the issue, I switched the session request for the slow operating file download to newSession(). Not only did this seem to prevent other requests from waiting on the slow download, it also resulted in lightening fast downloads suddenly. I was concerned that this might cause too many sessions, as some people scrape our site for the content downloads – however so far we’ve only got up-to 15 sessions on the Content Servers from the ‘public’ user.

Sharing sessions/session managers among thread is not safe, using newSession() is not safe too – please check my explanation on ECN. If you want to find a balance between performance and amount of content server sessions consider to implement a pool of session managers – you can simply adopt Commons Pool. Also, check how you transfer content from Content Server. I also may suggest to use ACS for content transfer operations but this will complicate your solution and most probably will have no benefits due to following reasons:

  • you will start depending on JMS, so you will need a backup plan for handling JMS availability issues
  • when creating ACS link Content Server generates SHA1 checksum for content – if your storage is slow it may be an issue because the content will be read twice: one time for generating SHA1 checksum, second time when sending content
  • never ever use this pattern for getting ACS urls – if ACS is unavailable IDfExportOperation transfers content to DFC host, use com.documentum.fc.client.IDfSysObject#getAcsRequests instead

Q & A. X

Q:

Hi,
I am trying to write a standalone DF/D2 program. I create a DFC session and then make it in D2 context by D2Session.initTBO. I think perform normal DFC set, save operation on a sysobject. When I try to apply a D2 configuration like D2AuditConfig.apply I get the below error How to correct this??

ERROR 1 – D2 lockbox file or D2Method.passphrase property within it could not be found.
Exception in thread “main” DfException:: THREAD: main; MSG: Impossible to decrypt the method server response; ERRORCODE: ff; NEXT: null
at com.emc.d2.api.methods.D2Method.start(D2Method.java:417)

A:

You have two options:

  • put and setup all Lockbox stuff onto client side
  • Take advantage of reflection:
    Field ticketField = D2Session.class.getField("s_ticket");
    ticketField.setAccessible(true);
    Map tickets = (Map) ticketField.get(null);
    tickets.put("docbase_name", "dmadmin_password");
    

Q:

Also, cant it disable Lockbox altogether in 7.2+D24.5 environment?

A:

Download latest (or m.b. previous to latest or so) service pack for D2 4.2, extract com.emc.common.java.crypto.AESCrypto class from C6-Common-4.2.0.jar, insert it into C6-Common-4.5.0.jar.

Q & A. IX

Hi,

i’m relatively new to the xCP2 (and documentum) world and i have a question: the color of the application’s background is blue and i don’t like blue… juste joking !

i couldn’t find anywhere tips about continuous integration. is there a way to build and xCP2 project with commande line ? i want to make a continuous integration using Jenkins, SOMETHING to build, and (i think)the xmstool to deploy it every night.
However, couldn’t find anything to build the project from command line(and i shearshed up to google page 5!) in a unix environnement. Do you have any clues about what i can use?

Thanks,
Regards,
Rochdi

Hi,

I’m not sure that I’ll able to answer your question because I have never tried to perform automatic builds of xCP2 projects before (actually, after some unsuccessful attempts to create a complex (not a “hello world”) xCP2 application we have found that at current moment xCP2 is completely unusable/unstable/unreliable/undocumented and switched back to WDK/DFC), however EMC folks tell that there is an option to mavenize xCP2 project – it seems that attempt to execute “mvm package” is doomed to failure if xCP Designer is up and running:

> G:\app\maven\3.2.3\bin\mvn package -Dmaven.repo.local=G:\app\xCPDesigner\maven

....

[ERROR] Unexpected system error packaging dar for project 'ap'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.120 s
[INFO] Finished at: 2015-07-30T21:34:08+10:00
[INFO] Final Memory: 18M/223M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.emc.xcp.builder:xcp-dar:1.0.8:run (xcp-dar) on project ap: 
   Xcp mojo executing command 'preparepackage' for project 'ap' failed unexpectedly: j
ava.lang.IllegalArgumentException: xcpProject must not be null.
[ERROR] at com.emc.xcp.builder.packaging.PackagerUtil.generateRunConfig(PackagerUtil.java:18)
[ERROR] at internal.com.emc.xcp.builder.packaging.projectpackagers.RunConfigPackager.doPackaging(RunConfigPackager.java:14)
[ERROR] at internal.com.emc.xcp.builder.packaging.InternalPackagerUtil.packageProject(InternalPackagerUtil.java:22)
[ERROR] at internal.com.emc.xcp.builder.packaging.maven.XcpDarCommand.execute(XcpDarCommand.java:43)
[ERROR] at internal.com.emc.xcp.builder.build.maven.MavenHookManager.execute(MavenHookManager.java:29)
[ERROR] at internal.com.emc.xcp.builder.build.maven.MavenHookServlet.doPost(MavenHookServlet.java:51)
[ERROR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
[ERROR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
[ERROR] at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
[ERROR] at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
[ERROR] at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
[ERROR] at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
[ERROR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
[ERROR] at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:384)
[ERROR] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
[ERROR] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)

but in offline mode it does build something (note designerPath property):

G:\app\maven\3.2.3\bin\mvn package -Dmaven.repo.local=G:\app\xCPDesigner\maven -DdesignerPath=G:\app\xCPDesigner

...

[INFO] Webapp assembled in [5613 msecs]
[INFO] Building war: G:\app\xCPDesigner\Applications\ap\ap\target\ap-ap-1.0.0.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:02 min
[INFO] Finished at: 2015-07-30T21:36:41+10:00
[INFO] Final Memory: 15M/218M
[INFO] ------------------------------------------------------------------------