<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Strange delays... in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7838#M2418</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Note:&lt;BR /&gt;for obtain commandContext I use:&lt;BR /&gt;CommandContext.getCurrent()&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thats indeed the correct way of getting the commandcontext inside of your Java classes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Now time to migrate to RC1 and Oracle…&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thats should be no problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Nov 2010 20:56:31 GMT</pubDate>
    <dc:creator>jbarrez</dc:creator>
    <dc:date>2010-11-02T20:56:31Z</dc:date>
    <item>
      <title>Strange delays...</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7831#M2411</link>
      <description>I hava process instance that creates new process intances of another process…Process A do a select to one table of database and creates a new process instance of process B for each row, moving contenue of table into variables of process B.Then, is strange that I have 2 operation that sometimes (not</description>
      <pubDate>Fri, 29 Oct 2010 10:26:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7831#M2411</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2010-10-29T10:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Strange delays...</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7832#M2412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That is extremely odd …&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What kind of variables are we talking here? How many? (not that it can explain the 20s delay)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any way you can wrap up a simple unit test that demonstrates the problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Oct 2010 12:20:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7832#M2412</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2010-10-29T12:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Strange delays...</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7833#M2413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'll try to simplify and see that If I can reproduce eliminating redudent actions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;True, it's now all executions appears this 20sec delay. (but not in each iteration, but each iteration does same)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next tuesday I'll do it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Oct 2010 13:19:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7833#M2413</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2010-10-29T13:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Strange delays...</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7834#M2414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Doing unit test I found the famous 20 sec. delays:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;10:25:48,442 FIN&amp;nbsp; | Waiting as long as 20000 milliseconds for connection.&amp;nbsp; [org.apache.ibatis.datasource.pooled.PooledDataSource]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I know the reason, my java service need make an insert/update to an auxiliary table (new table added inside activiti schema).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;ProcessEngineImpl engine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();&lt;BR /&gt;DbSqlSessionFactory dbSqlSessionFactory = ((ProcessEngineImpl)engine).getProcessEngineConfiguration().getDbSqlSessionFactory();&lt;BR /&gt;SqlSession mysql = dbSqlSessionFactory.getSqlSessionFactory().openSession();&lt;BR /&gt;Connection conn = mysql.getConnection();&lt;BR /&gt;PreparedStatement pstmt=conn.prepareStatement(INSERT_SQL);&lt;BR /&gt;…&lt;BR /&gt;pstmt.close();&lt;BR /&gt;pstmt=null;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Question1: is correct this code?&amp;nbsp; My target is be able to use sql, is there a best option for do the same?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Question2: How can do this sql with the same transaction of activiti?&amp;nbsp; if I commit and after activiti fails I will have inconsistent data…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suppose that my actual problem is derived that I don't have a commit&amp;amp;close.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 10:37:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7834#M2414</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2010-11-02T10:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Strange delays...</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7835#M2415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Adding:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;conn.commit();&lt;BR /&gt;conn.close();&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem solve, and 20 waitting disappears.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But… how can I made sql but playing with the same transaction that activiti? and if an error appears then all my changes rollback too…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 11:30:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7835#M2415</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2010-11-02T11:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Strange delays...</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7836#M2416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The 20 second delay is the Ibatis default waiting time, when it can't get a connection from the connection pool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Strange that a commit fixes it. However, you are right that this is not the right thing to do since it will mess up the transactional state of your process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need some way of getting the current connection (instead of creating a new one).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Therefore, you need to retrieve the DbSqlSession in a bit of a hacky way: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DbSqlSession dbSqlSession = commandContext.getDbSqlSession();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DefaultSqlSession sqlSession = (DefaultSqlSession) dbSqlSession.getSqlSession();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Connection conn = sqlSession.getConnection();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But this should be something that is provided out-of-the-box in Activiti.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I created a Jira for this: &lt;/SPAN&gt;&lt;A href="http://jira.codehaus.org/browse/ACT-305" rel="nofollow noopener noreferrer"&gt;http://jira.codehaus.org/browse/ACT-305&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 12:22:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7836#M2416</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2010-11-02T12:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Strange delays...</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7837#M2417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And now.. is more faster!! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&amp;nbsp; &lt;BR /&gt;DbSqlSession dbSqlSession = CommandContext.getCurrent().getDbSqlSession();&lt;BR /&gt;DefaultSqlSession sqlSession = (DefaultSqlSession) dbSqlSession.getSqlSession();&lt;BR /&gt;Connection conn = sqlSession.getConnection();&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for obtain commandContext I use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CommandContext.getCurrent()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now time to migrate to RC1 and Oracle…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 12:48:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7837#M2417</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2010-11-02T12:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Strange delays...</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7838#M2418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Note:&lt;BR /&gt;for obtain commandContext I use:&lt;BR /&gt;CommandContext.getCurrent()&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thats indeed the correct way of getting the commandcontext inside of your Java classes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Now time to migrate to RC1 and Oracle…&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thats should be no problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 20:56:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/strange-delays/m-p/7838#M2418</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2010-11-02T20:56:31Z</dc:date>
    </item>
  </channel>
</rss>

