Hey Everyone,

I have got a jsp "1.jsp" which will insert records in various tables. I'm using sql:transaction tag to group the sql statements together to provide transactional behavior. Some of these sql statements will be used by multiple jsps.

So I created a separate jsp "Common.jsp" which contains the sql statements which will be common for multiple jsps.

Heres how the code for 1.jsp looks like

<sql:transaction dataSource="${DataSourceName}">
<sql:update>
INSERT INTO TABLE1
</sql:update>

<sql:update>
INSERT INTO TABLE2
</sql:update>

<jsp:include page="Common.jsp" />

</sql:transaction>


and heres how the code for Common.jsp looks like
<sql:update>
INSERT INTO TABLE3
</sql:update>

<sql:update>
INSERT INTO TABLE4
</sql:update>
But Sql Statements in Common.jsp fails because it expects a DataSource name.

I want to execute all these statements as part of 1 transaction. Can anyone suggests me a way to have a separate jsp which will include the common sql statements and still be part of transaction in 1.jsp .

Thanks